main = do
  n <- readLn :: IO Int
  p <- (return . map (read::String->Int) . words) =<< getLine
  print $ foldl (\n i -> n + if (p!!i) < (minimum $ 2*10^5:take i p) then 1 else 0) 0 [0..(length p -1)]