import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int n = Integer.parseInt(scan.nextLine()); String line = scan.nextLine(); List height = new ArrayList<>(); Arrays.asList(line.split(" ")) .forEach(heightStr -> height.add(Integer.parseInt(heightStr))); int max = Integer.MIN_VALUE; int maxCount = 0; for(int heightItem : height) { if(heightItem > max) { max = heightItem; maxCount = 1; } else if(heightItem == max) { maxCount++; } } System.out.println(maxCount); } }