# Enter your code here. Read input from STDIN. Print output to STDOUT
count = gets.chomp
candles = gets.chomp.split(' ').map(&:to_i)

tallest = 0
count = 0
candles.each do |candle|
  if candle > tallest
    tallest = candle
    count = 1
  elsif candle == tallest
    count += 1
  end
end
puts count