
isok h [] = True
isok h (a:as) 
  | h >= a = isok h as
  | otherwise = False

ret [] = 0
ret (h:hs) 
  | isok h hs = 1 + ret hs
  | otherwise = ret hs


main = do
  n <- getLine
  hs <- ((map read . words) <$> getLine) :: IO [Int]
  putStrLn $ show $ ret (reverse hs)
