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(); Integer height[] = new Integer[n]; for(int height_i=0; height_i < n; height_i++){ height[height_i] = in.nextInt(); } dothis(height); } private static void dothis(Integer[] array) { List l = Arrays.asList(array); int max = Collections.max(l); int o = Collections.frequency(l, max); System.out.println(o); } }