using System; using System.Linq; class Solution { static void Main(String[] args) { int n = Convert.ToInt32(Console.ReadLine()); var currentMax = int.MinValue; var result = 0; foreach (var value in Console.ReadLine().Split(' ').Select(int.Parse)) { if (value > currentMax) { currentMax = value; result = 0; } if (currentMax == value) { result++; } } Console.WriteLine(result); } }