solve :: [Int] -> Int -> Int -> Int
solve [] passed minNumber = passed
solve (x:xs) passed minNumber =
  solve
    xs
    (if minNumber >= x then passed + 1 else passed)
    (min x minNumber)


main = do
  _ <- getLine
  numbers <- (map read . words) <$> getLine
  putStrLn $ show $ solve numbers 0 200001