#!/bin/ruby n = gets.strip.to_i height = gets.strip height = height.split(' ').map(&:to_i) max_height = nil height.each do |h| max_height = h if not max_height max_height = h if h >= max_height end count=0 height.each do |h| if h == max_height count+=1 end end puts count