main = do
  n <- readLn :: IO Int
  ps <- (return . map (read::String->Int) . words) =<< getLine
  print $ solve 0 (n+1) 0 ps
  where
    solve i m n ps | i == (length ps-1) = n + (if (ps!!i)<m then 1 else 0)
                   | otherwise = let m' = min (ps!!i) m
                                     n' = n + (if (ps!!i)<m then 1 else 0)
                                 in solve (i+1) m' n' ps