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) { int desc, maxvalue, max_freq = 0; Scanner in = new Scanner(System.in); int n = in.nextInt(); int height[] = new int[n]; for(int height_i=0; height_i < n; height_i++){ height[height_i] = in.nextInt(); } Arrays.sort(height); desc = height.length - 1; maxvalue = height[desc]; while (desc > -1) { if(height[desc] == maxvalue) { max_freq++; desc--; } else { desc = -1; } } System.out.println(max_freq); } }