import qualified Data.ByteString.Char8 as B
import           Data.List             (unfoldr)


readIntsLn :: IO [Int]
readIntsLn = unfoldr (B.readInt . B.dropWhile (== ' ')) <$> B.getLine

main :: IO ()
main = do
  n <- readLn
  ps <- readIntsLn
  print $ solve n ps

solve :: Int -> [Int] -> Int
solve _ ps = length . filter (\(p, q) -> p <= q) $ zip ps qs where
  qs = scanl1 min ps
