import Control.Monad
import Data.Maybe
import qualified Data.ByteString.Char8 as BS
import Data.List

readInt = fst . fromJust . BS.readInt
readIntList = map readInt . BS.words
getInt = readInt <$> BS.getLine
getIntList = readIntList <$> BS.getLine



main = do
    n <- getInt
    ps <- getIntList
    print . length $ solve (head ps) ps

solve min (p : []) = if min >= p then 1 else 0
solve min (p : ps) = if min >= p then 1 + solve p ps else solve min ps