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) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner sn = new Scanner(System.in); int numCandles = sn.nextInt(); Integer[] candlesHeight = new Integer[numCandles]; for (int cnt = 0; cnt < numCandles; cnt++) { candlesHeight[cnt] = sn.nextInt(); } sn.close(); int max = candlesHeight[0]; int numMax = 0; for (int i = 0; i < candlesHeight.length; i++) { if (candlesHeight[i] > max) { max = candlesHeight[i]; numMax = 1; } else if (candlesHeight[i] == max) { numMax++; } } System.out.printf("%d",numMax); } }