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 input = new Scanner(System.in); int n = input.nextInt(); //int[] candles = new int[n]; int tallest = 0; int current = tallest; int counter = 0; for(int i = 0; i < n; i++){ current = input.nextInt(); if(current > tallest){ tallest = current; counter = 1; }else if(current == tallest){ counter++; } } System.out.println(counter); } }