import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) throws Exception { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String input = in.readLine(); int s = Integer.parseInt(input); input = in.readLine(); String is[] = input.split(" "); int array[] = new int[s]; int max = 0; for(int i = 0; i < s; ++i) { int x = Integer.parseInt(is[i]); array[i] = x; if(x > max) max = x; } int res = 0; for(int i = 0; i < s; ++i) { if(array[i] == max) { ++res; } } System.out.println(res); } }