import           Control.Monad
import qualified Data.ByteString.Char8 as BS
import           Data.Char
import           Data.Maybe
import qualified Data.Vector.Unboxed   as V

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine

getIntVec n = V.unfoldrN n (BS.readInt . BS.dropWhile isSpace) <$> BS.getLine

main = do
  n <- getInt
  ps <- getIntVec n
  let inf = 10^6 :: Int
  print $ solve 0 inf 0 n ps
  where
    solve ans m i len xs | i == len = ans
                         | otherwise =
                           let x = xs V.! i
                               m' = min x m
                               ans' = if x <= m' then ans + 1 else ans
                           in
                             solve ans' m' (i+1) len xs