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 { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ int i,max,n,count=0; Scanner sc = new Scanner(System.in); n = sc.nextInt(); int[] h = new int[n]; for(i = 0;i < n;i++) { h[i]=sc.nextInt(); } max = h[0]; for(i = 1;i < n;i++) { if(h[i] > max) { max = h[i]; } } for(i = 0;i < n;i++) { if(h[i] == max) { count++; } } System.out.println(count); } }