import Control.Monad
import Data.List

main :: IO ()
main = do
  void getLine
  ps <- map read . words <$> getLine
  print $ solve ps

solve :: [Int] -> Int
solve = length . filter id . (zipWith (<=) <$> id <*> scanl1 min)
