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. */ Scanner reader = new Scanner(System.in); int n = reader.nextInt(); int[] height = new int[n]; int max = 0; int qty = 0; for (int i = 0; i < n; i++) { height[i] = reader.nextInt(); } for (int j = 0; j < n; j++) { if (height[j] > max) { max = height[j]; } } for (int k = 0; k < n; k++) { if (height[k] == max) { qty++; } } System.out.println(qty); } }