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 scanner = new Scanner(System.in); int n = scanner.nextInt(); int max = 0; int maxCount = 0; for (int i = 0; i < n ; i++) { int val = scanner.nextInt(); if (val > max) { max = val; maxCount = 1; } else if (val == max) { maxCount++; } } System.out.println(maxCount); } }