import java.io.*; import java.util.*; 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 in = new Scanner(System.in); int n = in.nextInt(); int[] candles = new int[n]; for(int i=0; i < n; i++){ candles[i] = in.nextInt(); } in.close(); ArrayList al = new ArrayList(); for (int i = 0; i < candles.length; i++) { al.add(candles[i]); } Arrays.sort(candles); int bigger = candles[candles.length - 1]; int count = 0; for(int i = (candles.length-1); i >= 0; i--){ if(candles[i] == bigger){ count++; } else { break; } } System.out.println(count); } }