#!/bin/ruby n = gets.strip.to_i height = gets.strip height = height.split(' ').map(&:to_i) max = height.max() p height.count { |e| e == max }