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 in = new Scanner(System.in); int n = in.nextInt(); int height[] = new int[n]; int max = 0; int total_of_max = 0; for(int height_i=0; height_i < n; height_i++){ int temp = in.nextInt(); if (temp > max) { max = temp; total_of_max = 1; //total_of_max++; } else if (temp == max) { total_of_max++; } } System.out.print(total_of_max); } }