import java.io.*; import java.util.*; import java.text.*; import java.math.*; import java.util.regex.*; import java.util.Scanner; public class Solution { public static void main(String[] args) { Scanner scan = new Scanner(System.in); int max = Integer.MIN_VALUE; int total = 0; int num = scan.nextInt(); for(int i = 0; i < num; i++) { int height = scan.nextInt(); if(height > max) { max = height; total = 1; } else if(height == max) total++; } System.out.println(total); } }