cnt :: [Int] -> Int -> Int -> Int
cnt ls n i | n <= i = 0
           | otherwise = if all (<= ls!!i) (take (i+1) ls) then 1+ (cnt ls (i+1)) else (cnt ls (i+1))

main :: IO ()
main = do
  n <- readLn :: IO Int
  ls <- map read.words <$> getLine :: IO [Int]
  print $ cnt ls n 0