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 scan = new Scanner(System.in); int numElements = Integer.parseInt(scan.nextLine()); int maxHeight = 0; int numCandles = 0; String[] candleHeights = scan.nextLine().split(" "); scan.close(); for(int i = 0; i < numElements; i++){ if(Integer.parseInt(candleHeights[i]) > maxHeight){ maxHeight = Integer.parseInt(candleHeights[i]); numCandles = 1; }else if(Integer.parseInt(candleHeights[i]) == maxHeight){ numCandles++; } } System.out.print(numCandles); } }