toInt :: (String -> Int)
toInt x = read x ::Int

getInts :: IO [Int]
getInts = do
  x <- getLine
  let y = (map$toInt)$words x
  return y




cll :: [Int] -> Int
cll xs = cwsl xs 0 True
  where
  cwsl :: [Int] -> Int -> Bool -> Int
  cwsl [] _ _ = 0
  cwsl (x:xs) _ True = 1 + cwsl xs x False
  cwsl (x:xs) n False = (if x<n then 1 else 0) + cwsl xs (min x n) False
    





main = do
  n <- getInts
  x <- getInts
  putStrLn $ show (cll x)