import java.io.*; import java.util.*; public class Solution { public static void main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution. */ Scanner in = new Scanner(System.in); int n = in.nextInt(); int tall_candle = in.nextInt(); int count = 1; for (int count_n = 0; count_n < n-1; count_n++){ int new_candle = in.nextInt(); if (new_candle > tall_candle){ tall_candle = new_candle; count = 1; } else{ if (new_candle == tall_candle){ count++; } else{ } } } System.out.println(count); } }