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 height[] = new int[n]; int max_height = Integer.MIN_VALUE; for(int height_i=0; height_i < n; height_i++){ height[height_i] = in.nextInt(); if(height[height_i] > max_height){ max_height = height[height_i]; } } Map candleMap = new HashMap<>(); for(int i = 0; i < height.length; i++){ Integer value = candleMap.get(height[i]); if(value==null){ value = 0; } value++; candleMap.put(height[i],value); } System.out.println(candleMap.get(max_height)); } }