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