n = int(eval(input()))

a = sorted([int(i) for i in input().split()])

ans = 1

dic = {}

for i in range(10**5):

    dic[i] = 0

for i in a:

    dic[i] += 1

for i in range(1,10**5-1):

    ans = max(ans, dic[i-1] + dic[i] + dic[i+1])

print(ans)
n = int(eval(input()))

a = sorted(list(map(int, input().split())))

b = [0] * 10**5

ans = 1

if n == 2:

    if abs(a[0] - a[1]) <= 2:

        ans = 2

for i in range(n):

    b[a[i]] += 1

for i in range(n-2):

    ans = max(ans, b[i]+b[i+1]+b[i+2])



print(ans)
n = int(eval(input()))
a = sorted([int(i) for i in input().split()])
ans = 1
dic = {}
for i in range(10**5):
    dic[i] = 0
for i in a:
    dic[i] += 1
for i in range(1, 10**5 - 1):
    ans = max(ans, dic[i - 1] + dic[i] + dic[i + 1])
print(ans)

n = int(eval(input()))
a = sorted(list(map(int, input().split())))
b = [0] * 10**5
ans = 1
if n == 2:
    if abs(a[0] - a[1]) <= 2:
        ans = 2
for i in range(n):
    b[a[i]] += 1
for i in range(n - 2):
    ans = max(ans, b[i] + b[i + 1] + b[i + 2])
print(ans)

-a = sorted([int(i) for i in input().split()]) +a = sorted(list(map(int, input().split()))) +b = [0] * 10**5 -dic = {} -for i in range(10**5): -    dic[i] = 0 -for i in a: -    dic[i] += 1 -for i in range(1, 10**5 - 1): -    ans = max(ans, dic[i - 1] + dic[i] + dic[i + 1]) +if n == 2: +    if abs(a[0] - a[1]) <= 2: +        ans = 2 +for i in range(n): +    b[a[i]] += 1 +for i in range(n - 2): +    ans = max(ans, b[i] + b[i + 1] + b[i + 2])