main :: IO ()
main = do
    _  <- getLine
    xs <- fmap read . words <$> getLine
    answer $ solve xs

type Answer = Int
answer :: Answer -> IO ()
answer = print

solve :: [Int] -> Answer
solve = inner 0 0 . head <*> tail
  where
    inner n d p (x : xs)
      | x  <  p   = inner n  d  x xs
      | d' == d   = inner n' d  p xs
      | d' >  d   = inner 1  d' p xs
      | otherwise = inner n  d  p xs
      where
        d' = x - p
        n' = succ n
    inner n _ _ _ = n
