# Enter your code here. Read input from STDIN. Print output to STDOUT

def candles(arr)
  max = arr.max
  arr.count(max)
end

n = gets.to_i
height = gets.split.map(&:to_i)

puts candles(height)