using System; using System.Collections.Generic; using System.IO; class Solution { static void Main(String[] args) { /* Enter your code here. Read input from STDIN. Print output to STDOUT. Your class should be named Solution */ int numCandles = Int32.Parse(Console.ReadLine()); string[] candleStrings = Console.ReadLine().Split(' '); int[] candles = new int[candleStrings.Length]; for (int i = 0; i < candleStrings.Length; i++) { candles[i] = Int32.Parse(candleStrings[i]); } Array.Sort(candles); int highestNum = candles[candles.Length - 1]; int currentNum = highestNum; int count = candles.Length - 1; int answer = 0; while(currentNum == highestNum && count >= 0) { currentNum = candles[count]; if( currentNum == highestNum) { answer++; } count--; } Console.WriteLine(answer); } }