n = int(eval(input()))

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

D = [0]*(A[-1]+3)

for a in A:

    D[a-1] += 1

    D[a] += 1

    D[a+1] += 1

print((max(D)))
n = int(eval(input()))

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

cnt = [0] * 10**5

for a in A:

    cnt[a] += 1

print((max(list(map(sum, list(zip(cnt, cnt[1:], cnt[2:])))))))
n = int(eval(input()))
A = sorted(map(int, input().split()))
D = [0] * (A[-1] + 3)
for a in A:
    D[a - 1] += 1
    D[a] += 1
    D[a + 1] += 1
print((max(D)))

n = int(eval(input()))
A = list(map(int, input().split()))
cnt = [0] * 10**5
for a in A:
    cnt[a] += 1
print((max(list(map(sum, list(zip(cnt, cnt[1:], cnt[2:])))))))

-A = sorted(map(int, input().split())) -D = [0] * (A[-1] + 3) +A = list(map(int, input().split())) +cnt = [0] * 10**5 -    D[a - 1] += 1 -    D[a] += 1 -    D[a + 1] += 1 -print((max(D))) +    cnt[a] += 1 +print((max(list(map(sum, list(zip(cnt, cnt[1:], cnt[2:])))))))