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) { /* 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 candles = in.nextInt(); int height; int max_ht = 0, max_count = 0; for(int candle = 0; candle < candles; candle ++){ height = in.nextInt(); if(height > max_ht){ max_ht = height; max_count = 0; max_count += 1; }else if (height == max_ht){ max_count += 1; } } System.out.println(max_count); } }