import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner in = new Scanner(System.in); int numberOfCandles = in.nextInt(); int maxHeight = 0; int numberOfMaxHeight = 0; int[] candles = new int[numberOfCandles]; for(int i = 0; i < numberOfCandles; i++) { int tempInt = in.nextInt(); candles[i] = tempInt; if( candles[i] > maxHeight ) { numberOfMaxHeight = 0; maxHeight = candles[i]; } if(candles[i] == maxHeight ) numberOfMaxHeight++; } System.out.println(numberOfMaxHeight); } }