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