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 noOfCandles = in.nextInt(); int[] candleHeights = new int[noOfCandles]; int maximum = 0; for(int i = 0; i < candleHeights.length; i++) { candleHeights[i] = in.nextInt(); if(maximum < candleHeights[i]) { maximum = candleHeights[i]; } } int counter = 0; for(int j = 0; j < candleHeights.length; j++) { if(maximum == candleHeights[j]) { counter++; } } System.out.println(counter); } }