import           Control.Monad (replicateM)

solve :: [Int] -> Int
solve = go maxBound 0
  where
    go m c [] = c
    go m c (x:xs)
      | x <= m = go x (c + 1) xs
      | otherwise = go m c xs

main :: IO ()
main = do
  n <- readLn :: IO Int
  print =<< solve <$> replicateM n readLn