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) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int max = Integer.MIN_VALUE; int height[] = new int[n]; int counter = 0; for(int height_i = 0; height_i < n; height_i++){ height[height_i] = in.nextInt(); } for(int i = 0; i < height.length; i++) { if(height[i] > max) { max = height[i]; } } for(int j = 0; j < height.length; j++) { if(height[j] == max) counter++; } System.out.println(counter); } }