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

main = do
  _ <- getLine
  as <- map (maybe undefined fst . B.readInt) . B.words <$> B.getLine
  print (sarray as)

sarray as
  | null ds = 1
  | head ds < 0 = length (cut True as)
  | otherwise = length (cut False as)
  where
    ds = filter (/= 0) $ zipWith (-) (tail as) as

cut _ [] = []
cut False xs = () : cut True (dropWhileBy (<=) xs)
cut True xs = () : cut False (dropWhileBy (>=) xs)

takeWhileBy _ [] = []
takeWhileBy _ [x] = [x]
takeWhileBy op (x1:xxs@(x2:_))
  | op x1 x2 = x1 : takeWhileBy op xxs
  | otherwise = [x1]

dropWhileBy _ [] = []
dropWhileBy _ [x] = []
dropWhileBy op (x1:xxs@(x2:_))
  | op x1 x2 = dropWhileBy op xxs
  | otherwise = xxs
