import java.io.*; import java.util.*; 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 scan = new Scanner(System.in); int n = scan.nextInt(); if(n <= 0) return; int[] array = new int[n]; int max = Integer.MIN_VALUE; for(int i = 0; i < n; i++) { array[i] = scan.nextInt(); if(max < array[i]) max = array[i]; } int count = 0; for(int i = 0; i < array.length; i++) { if(max == array[i]) count++; } System.out.println(count); } }