main = do
  n <- readLn :: IO Int
  ps <- map read . words <$> getLine :: IO [Int]
  putStrLn $ show $ count ps

foldlState :: (a -> c -> b -> (a, c)) -> a -> c -> [b] -> a
foldlState f a s l = fst $ foldl (\(a, s) -> f a s) (a, s) l

count :: [Int] -> Int
count ps = foldlState step 0 (head ps) ps
    where step a m x = if m < x then (a, m) else (a + 1, x)
