import qualified Data.ByteString.Char8 as BS
import Data.Maybe

getInts :: IO [Int]
getInts = map (fst . fromJust . BS.readInt) . BS.words <$> BS.getLine

main :: IO ()
main = do
  _ <- readLn :: IO Int
  p <- getInts
  
  print $ length $ filter id $ zipWith (<=) p (tail $ scanl min maxBound p)