import Data.List
import Data.Function

gaps :: [(Int, Int)] -> [(Int, (Int, Int))]
gaps [] = []
gaps ((x,i):xs) = hs ++ gaps xs
  where hs = map (\(y,j) -> (y - x, (i, j))) xs

maxGapIndices :: [(Int, (Int, Int))] -> [(Int, Int)]
maxGapIndices xs =
  fmap snd $ head $
  groupBy ((==) `on` fst) $
  sortBy (flip (compare `on` fst)) xs

nubByBoth :: (Ord a, Ord b) => [(a, b)] -> [(a, b)]
nubByBoth = (nubBy ((==) `on` fst)) . (nubBy ((==) `on` snd))

main :: IO ()
main = do
  getLine
  line <- getLine
  let xs = read <$> words line :: [Int]
  print $ length $ nubByBoth $ maxGapIndices $ gaps $ zip xs [0..]
