using System; using System.Collections.Generic; using System.IO; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); string[] height_temp = Console.ReadLine().Split(' '); int[] height = Array.ConvertAll(height_temp,Int32.Parse); /*var candles = new Stack(); candles.Push(height[0]); int count = 1; for (int i = 1; i < n; i++) { if (candles.Peek() <= height[i]) { count++; candles.Push(height[i]); } }*/ Array.Sort(height); int max = height[n-1]; int count = 1; int i = n-2; while (i >= 0) { if (max == height[i]) { count++; i--; } else break; } Console.WriteLine(count); } }