main = do
  n <- readLn :: IO Int
  ps <- (return . map (read::String->Int) . words) =<< getLine
  print $ solve 0 (n+1) 0 n ps
  where
    solve i m n ln ps | i == (ln-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' ln ps
