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