from collections import Counter



N = int(eval(input()))

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

ac = Counter(a)

ans = 0



for i in list(ac.keys()):

    ans = max(ans, ac[i] + ac[i + 1] + ac[i - 1])



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

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

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



for i in a:

    b[i - 1] += 1

    b[i] += 1

    b[i + 1] += 1

print((max(b)))
from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
ac = Counter(a)
ans = 0
for i in list(ac.keys()):
    ans = max(ans, ac[i] + ac[i + 1] + ac[i - 1])
print(ans)

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

-from collections import Counter - -ac = Counter(a) -ans = 0 -for i in list(ac.keys()): -    ans = max(ans, ac[i] + ac[i + 1] + ac[i - 1]) -print(ans) +b = [0] * (10**5 + 2) +for i in a: +    b[i - 1] += 1 +    b[i] += 1 +    b[i + 1] += 1 +print((max(b)))