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. */ //input Scanner input = new Scanner(System.in); int numOfCandles = input.nextInt(); int [] heights = new int[numOfCandles]; for (int i = 0; i < numOfCandles; i++) { heights[i] = input.nextInt(); } //finding tallest candle height int record = 0; for (int h: heights) { if (h > record) { record = h; } } //how many candles with tallest height int count = 0; for (int h: heights){ if (h == record){ count++; } } //output System.out.print(count); } }