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 in = new Scanner(System.in); int n = in.nextInt(); int max_height = 0; int num_candles = 0; for(int height_i=0; height_i < n; height_i++){ int cur_candle = in.nextInt(); if (cur_candle > max_height) { max_height = cur_candle; num_candles = 1; } else if ( cur_candle == max_height ) { num_candles++; } } System.out.println(num_candles); } }