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 scan = new Scanner(System.in); int N = scan.nextInt(); scan.nextLine(); String num =scan.nextLine(); String[] arr = new String[N]; arr = num.split(" "); int max = Integer.parseInt(arr[0]); int count = 1; for(int i=1; i< N; i++) { if(Integer.parseInt(arr[i])>max) { max=Integer.parseInt(arr[i]); count = 1; } else if(Integer.parseInt(arr[i]) == max) count++; } System.out.println(count); } }