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 scanner = new Scanner(System.in); int N = scanner.nextInt(); HashMap<Integer,Integer> map = new HashMap<>(); int max = 0; for(int i=0;i<N;i++) { int candle = scanner.nextInt(); if(max < candle) max = candle; if(map.containsKey(candle)) map.put(candle,map.get(candle)+1); else map.put(candle,1); } System.out.println(map.get(max)); } }