import Control.Monad

main = do
    n <- read <$> getLine
    h <- map read <$> words <$> getLine
    putStrLn $ show $ solve n h

solve :: Int -> [Int] -> Int
solve n h = doit 0 h
  where
    doit m []                = 0
    doit m (h:t) | m > h     = 0 + doit m t
                 | otherwise = 1 + doit h t
