import Data.Array.IO

rInt = read :: String -> Int

type Ary = IOUArray Int Int

increment :: Ary -> Int -> IO ()
increment ary x = do
    v <- readArray ary x
    writeArray ary x (v + 1)

main = do
    n <- rInt <$> getLine
    a <- ((map rInt) . words) <$> getLine
    ary <- newArray (-1,100001) 0 :: IO Ary
    mapM_ (increment ary) $ (map (+) [-1..1]) <*> a
    (maximum <$> getElems ary) >>= print
    