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