main :: IO ()
main = do
  n <- read <$> getLine :: IO Int
  hs <- map read . words <$> getLine :: IO [Int]
  print . fst . foldl step (0, 0) $ hs

step :: (Int, Int) -> Int -> (Int, Int)
step l@(k, m) h = if h >= m then (succ k, h) else l
