import Control.Monad
import System.Random

main :: IO ()
main = do
    n <- fmap read getLine
    as <- (replicateM n (fmap read getLine)) :: IO [Int]
    putStrLn (show $ pirupiru as)

pirupiru :: [Int] -> Int
pirupiru ns =   if ns == [] then 0
                else 1 + pirupiru (deletesuru (maximum ns) ns)

deletesuru :: Int -> [Int] -> [Int]
deletesuru x xs = filter (/= x) xs

