main = getLine >> getLine >>= putStrLn . show . solve . map read . words
solve :: [Int] -> Int
solve xs = solve' 1 'N' $ zip xs (tail xs)
solve' n _ [] = n
solve' n t ((a,b):ps)
    | t == 'I'  = if a <= b then solve' n t ps
                            else solve' (n + 1) 'N' ps
    | t == 'D'  = if a >= b then solve' n t ps
                            else solve' (n + 1) 'N' ps
    -- t == 'N'
    | a < b     = solve' n 'I' ps
    | a > b     = solve' n 'D' ps
    | otherwise = solve' n t ps
