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 scan = new Scanner(System.in); long N = scan.nextLong(); long max = Long.MIN_VALUE; int count = 0; for (int i = 0; i < N; i++){ long h = scan.nextLong(); if (h == max) count++; if (h > max) { max = h; count = 1; } } System.out.println(count); } }