import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; public class Solution { public static void main(String[] args) throws IOException { BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int n = Integer.parseInt(br.readLine()); String height[] = br.readLine().split(" "); long max_num=-1; int occurences=0; Long h; for(String ht:height){ h= Long.valueOf(ht); if(h>max_num){ max_num =h; occurences=1; } else if(h==max_num) occurences++; } System.out.println(occurences); } }