import System.IO candlesBlown :: [Integer] -> Int candlesBlown [] = 0 candlesBlown heights = length $ filter (== (maximum heights)) heights main = do l0 <- getLine l1 <- getLine let n = read l0 heights = take n $ map read (words l1) putStrLn $ show (candlesBlown heights)