f _  [_] = 1
f o (x:xs@(y:_))
  | p == EQ = f o xs
  | o == EQ || o == p = f p xs
  | otherwise = 1 + f EQ xs
  where p = x `compare` y
main = do
  getLine
  as <- map read . words <$> getLine :: IO [Integer]
  print $ f EQ as