main = do
  n <- getLine
  ln <- getLine
  let as = map (\i -> read i :: Int) $ words ln
  let xs = [(minimum as) - 1 .. (maximum as) + 1]
  print $ maximum $ map (\x -> length $ filter (\a -> elem (a - x) [-1..1]) as) xs