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 numCandles = in.nextInt(); int heights[] = new int[numCandles]; int count = 0; int maxHeight = 0; int numMax = 1; for(int x = 0; x < numCandles; x++) { heights[x] = in.nextInt(); count++; if(heights[x] > maxHeight) { maxHeight = heights[x]; numMax = 1; } else if (heights[x] == maxHeight) { numMax++; } } System.out.println(numMax); } }