candles = gets.chomp.to_i candle_height = gets.chomp.split.map { |n| n.to_i } max = candle_height.max count = 0 candle_height.each do |i| if i == max count += 1 end end puts count