N = int(eval(input()))

A = [int(x) for x in input().split()]



data = {}

for a in A:

    for i in range(3): #a-1,a,a+1をカウント

        if a-1+i in data:

            data[a-1+i] += 1

        else:

            data[a-1+i] = 1

            

#カウントしたものの最大値が答え

ans = 0

for d in list(data.values()):

    ans = max(ans, d)

print(ans)
from collections import Counter

with open(0) as f:

    N, *a = list(map(int, f.read().split()))

data = [x-1 for x in a] + [x for x in a] + [x+1 for x in a]

ans = Counter(data).most_common(1)[0][1]

print(ans)
N = int(eval(input()))
A = [int(x) for x in input().split()]
data = {}
for a in A:
    for i in range(3):  # a-1,a,a+1をカウント
        if a - 1 + i in data:
            data[a - 1 + i] += 1
        else:
            data[a - 1 + i] = 1
# カウントしたものの最大値が答え
ans = 0
for d in list(data.values()):
    ans = max(ans, d)
print(ans)

from collections import Counter

with open(0) as f:
    N, *a = list(map(int, f.read().split()))
data = [x - 1 for x in a] + [x for x in a] + [x + 1 for x in a]
ans = Counter(data).most_common(1)[0][1]
print(ans)

-N = int(eval(input())) -A = [int(x) for x in input().split()] -data = {} -for a in A: -    for i in range(3):  # a-1,a,a+1をカウント -        if a - 1 + i in data: -            data[a - 1 + i] += 1 -        else: -            data[a - 1 + i] = 1 -# カウントしたものの最大値が答え -ans = 0 -for d in list(data.values()): -    ans = max(ans, d) +from collections import Counter + +with open(0) as f: +    N, *a = list(map(int, f.read().split())) +data = [x - 1 for x in a] + [x for x in a] + [x + 1 for x in a] +ans = Counter(data).most_common(1)[0][1]