import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { Scanner sc = new Scanner(System.in); int count = sc.nextInt(); HashMap candles = new HashMap<>(); long maxCandle = -1; for (int i = 0; i < count; i++) { long height = sc.nextLong(); if (height > maxCandle ) { maxCandle = height; } if (candles.containsKey(height)) { candles.put(height, candles.get(height) + 1L); } else { candles.put(height, 1L); } } System.out.println(candles.get(maxCandle)); } }