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[] arr = new int[n]; int max = 0; int count = 0; for (int i = 0; i < n; i++) { int candle = scan.nextInt(); if (candle > max) { max = candle; count = 1; } else if (candle == max) { count++; } } System.out.println(count); } }