import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner s = new Scanner(System.in); int size = s.nextInt(); int candleSizes[] = new int[size]; int maxx = 0; int countTallest = 0; for(int i = 0; i < size; i++) { candleSizes[i] = s.nextInt(); if(candleSizes[i] > maxx) maxx = candleSizes[i]; } for(int i = 0; i < size; i++) { if(candleSizes[i] == maxx) countTallest++; } System.out.println(String.valueOf(countTallest)); } }