n = int(eval(input()))

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

check = [0]*((10**5)+1)

for i in a:check[i] += 1

ans = check[0] + check[1]

for i in range(len(check)-2):ans = max(ans,check[i]+check[i+1]+check[i+2])

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

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

count = [0]*(10**5+5)

for v in a:

    count[v] += 1



maxX = 0

maxV = 0



for i in range(10**5+1):

    val = count[i-1] + count[i] + count[i+1]

    if val > maxV:

        maxV = val

        maxX = i

print(maxV)
n = int(eval(input()))
a = list(map(int, input().split()))
check = [0] * ((10**5) + 1)
for i in a:
    check[i] += 1
ans = check[0] + check[1]
for i in range(len(check) - 2):
    ans = max(ans, check[i] + check[i + 1] + check[i + 2])
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
count = [0] * (10**5 + 5)
for v in a:
    count[v] += 1
maxX = 0
maxV = 0
for i in range(10**5 + 1):
    val = count[i - 1] + count[i] + count[i + 1]
    if val > maxV:
        maxV = val
        maxX = i
print(maxV)

-check = [0] * ((10**5) + 1) -for i in a: -    check[i] += 1 -ans = check[0] + check[1] -for i in range(len(check) - 2): -    ans = max(ans, check[i] + check[i + 1] + check[i + 2]) -print(ans) +count = [0] * (10**5 + 5) +for v in a: +    count[v] += 1 +maxX = 0 +maxV = 0 +for i in range(10**5 + 1): +    val = count[i - 1] + count[i] + count[i + 1] +    if val > maxV: +        maxV = val +        maxX = i +print(maxV)