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 in = new Scanner(System.in); int size = in.nextInt(); long max = in.nextLong(); long count = 1; long temp; for(int i = 1; i < size; i++){ temp = in.nextLong(); if(temp > max){ max = temp; count = 1; } else if(temp == max){ count++; } } System.out.print(count); } }