from collections import Counter

N = int(eval(input()))

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

ctr = Counter(src)



mx = max(src)

ans = 0

for i in range(mx+1):

    ans = max(ans, ctr[i] + ctr[i+1] + ctr[i+2])

print(ans)

N = int(eval(input()))

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

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

for a in src:

    mem[a] += 1

    mem[a+1] += 1

    mem[a+2] += 1

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

N = int(eval(input()))
src = list(map(int, input().split()))
ctr = Counter(src)
mx = max(src)
ans = 0
for i in range(mx + 1):
    ans = max(ans, ctr[i] + ctr[i + 1] + ctr[i + 2])
print(ans)

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

-from collections import Counter - -ctr = Counter(src) -mx = max(src) -ans = 0 -for i in range(mx + 1): -    ans = max(ans, ctr[i] + ctr[i + 1] + ctr[i + 2]) -print(ans) +mem = [0] * (10**5 + 2) +for a in src: +    mem[a] += 1 +    mem[a + 1] += 1 +    mem[a + 2] += 1 +print((max(mem)))