module Main where
import Data.List

int = read :: String -> Int

main = interact $ printer . solver . parser

printer = unlines . (:[]) . show

parser = map int . tail . words

solver is = result 
  where
    ps = map (+1) is
    ms = map (subtract 1) is
    sorted = sort (ps ++ is ++ ms)
    result = maximum . map length . group $ sorted
