n = int(eval(input()))

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

cnt_x = [0] * (10**5 + 2)

for i in range(n):

    cnt_x[a[i] - 1] += 1

    cnt_x[a[i]] += 1

    cnt_x[a[i] + 1] += 1

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

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

cnt_x = [0] * (10**5 + 2)

for a in A:

    cnt_x[a - 1] += 1

    cnt_x[a] += 1

    cnt_x[a + 1] += 1

print((max(cnt_x)))
n = int(eval(input()))
a = [int(i) for i in input().split()]
cnt_x = [0] * (10**5 + 2)
for i in range(n):
    cnt_x[a[i] - 1] += 1
    cnt_x[a[i]] += 1
    cnt_x[a[i] + 1] += 1
print((max(cnt_x)))

n = int(eval(input()))
A = [int(i) for i in input().split()]
cnt_x = [0] * (10**5 + 2)
for a in A:
    cnt_x[a - 1] += 1
    cnt_x[a] += 1
    cnt_x[a + 1] += 1
print((max(cnt_x)))

-a = [int(i) for i in input().split()] +A = [int(i) for i in input().split()] -for i in range(n): -    cnt_x[a[i] - 1] += 1 -    cnt_x[a[i]] += 1 -    cnt_x[a[i] + 1] += 1 +for a in A: +    cnt_x[a - 1] += 1 +    cnt_x[a] += 1 +    cnt_x[a + 1] += 1