gets candles = gets.strip.split.map(&:to_i).sort candle_count = 1 max_height = candles.pop while candles.pop == max_height candle_count += 1 end puts candle_count