N = int(eval(input()))

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

C = {}

for i in range(N):

    if A[i] not in C:

        C[A[i]] = 0

    C[A[i]] += 1

cmax = 0

for a in A:

    cnt = C[a]

    if a-1 in C:

        cnt += C[a-1]

    if a+1 in C:

        cnt += C[a+1]

    cmax = max(cmax,cnt)

print(cmax)
N = int(eval(input()))

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

C = {i:0 for i in range(0,10**5)}

for i in range(N):

    C[A[i]] += 1

cmax = 0

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

    cnt = C[x]+C[x-1]+C[x+1]

    cmax = max(cmax,cnt)

print(cmax)
N = int(eval(input()))
A = list(map(int, input().split()))
C = {}
for i in range(N):
    if A[i] not in C:
        C[A[i]] = 0
    C[A[i]] += 1
cmax = 0
for a in A:
    cnt = C[a]
    if a - 1 in C:
        cnt += C[a - 1]
    if a + 1 in C:
        cnt += C[a + 1]
    cmax = max(cmax, cnt)
print(cmax)

N = int(eval(input()))
A = list(map(int, input().split()))
C = {i: 0 for i in range(0, 10**5)}
for i in range(N):
    C[A[i]] += 1
cmax = 0
for x in range(1, 10**5 - 1):
    cnt = C[x] + C[x - 1] + C[x + 1]
    cmax = max(cmax, cnt)
print(cmax)

-C = {} +C = {i: 0 for i in range(0, 10**5)} -    if A[i] not in C: -        C[A[i]] = 0 -for a in A: -    cnt = C[a] -    if a - 1 in C: -        cnt += C[a - 1] -    if a + 1 in C: -        cnt += C[a + 1] +for x in range(1, 10**5 - 1): +    cnt = C[x] + C[x - 1] + C[x + 1]