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) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ HashMap map = new HashMap(); try{ BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); int size = Integer.parseInt(br.readLine()); String values = br.readLine(); String[] arr = values.split(" "); int max = 0; for(int i = 0; i < arr.length; i++){ int key = Integer.parseInt(arr[i]); if(key > max){ max = key; } // keep count of every number if(!map.containsKey(key)){ map.put(key, 1); } else{ map.put(key, map.get(key)+1); } } System.out.println(map.get(max)); } catch(IOException io){ io.printStackTrace(); } } }