main = do
    n <- getLine
    p <- getLine >>= return . map (read :: String -> Int) . words
    let (_,a) = solve $ reverse p
    putStrLn $ show a

solve :: [Int] -> (Int,Int) -- (min,ans)
solve (x:[]) = (x,1)
solve (x:xs)
    | x < y = (x,z+1)
    | otherwise = (y,z)
    where (y,z) = solve xs