import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner input = new Scanner(System.in); int aSize = input.nextInt(); int[] a = new int[aSize]; for(int i = 0; i < a.length; i++){ a[i] = input.nextInt(); } candles(a); } public static void candles(int[] a){ int max = 0; int counter = 1; for(int i = 0; i < a.length; i++){ if(a[i] > max){ max = a[i]; counter = 1; } else if(a[i] == max){ counter ++; } } System.out.println(counter); } }