from collections import Counter

N = int(eval(input()))

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



C = Counter(A)

ans = 0

for e in C:

    ans = max(ans,C[e]+C[e-1]+C[e+1])

print(ans)

N = int(eval(input()))

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

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

for e in a:

    b[e+1] += 1

ans = 0

for k in range(10**5+2):

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

print(ans)

from collections import Counter

N = int(eval(input()))
A = list(map(int, input().split()))
C = Counter(A)
ans = 0
for e in C:
    ans = max(ans, C[e] + C[e - 1] + C[e + 1])
print(ans)

N = int(eval(input()))
a = list(map(int, input().split()))
b = [0] * (10**5 + 10)
for e in a:
    b[e + 1] += 1
ans = 0
for k in range(10**5 + 2):
    ans = max(ans, b[k] + b[k + 1] + b[k + 2])
print(ans)

-from collections import Counter - -A = list(map(int, input().split())) -C = Counter(A) +a = list(map(int, input().split())) +b = [0] * (10**5 + 10) +for e in a: +    b[e + 1] += 1 -for e in C: -    ans = max(ans, C[e] + C[e - 1] + C[e + 1]) +for k in range(10**5 + 2): +    ans = max(ans, b[k] + b[k + 1] + b[k + 2])