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

main = do
    _  <- getLine
    xs <- map (read . BS.unpack) . BS.words <$> BS.getLine ::IO[Int]
    let as = [minimum x | x<-tail(inits xs)]
    print $ length [1|(a,b)<- zip xs as, a==b]