import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int n = in.nextInt(); int[] h = new int[n]; for(int i = 0; i < n; i++) { h[i] = in.nextInt(); } int highNum = 0; for(int c = 0; c < n; c++) { if(h[c] > highNum) highNum = h[c]; } int finalCount = 0; for(int t = 0; t < n; t++) { if(h[t] == highNum) finalCount++; } System.out.print(finalCount); } }