N = int(eval(input()))

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



from collections import Counter

ctr = Counter(A)

ans = 0

for i in range(10**5+1):

    t = ctr[i-1] + ctr[i] + ctr[i+1]

    ans = max(ans,t)

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

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

from collections import Counter

ctr = Counter(A)



ans = 0

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

    t = ctr[x-1] + ctr[x] + ctr[x+1]

    ans = max(t,ans)

print(ans)
N = int(eval(input()))
A = list(map(int, input().split()))
from collections import Counter

ctr = Counter(A)
ans = 0
for i in range(10**5 + 1):
    t = ctr[i - 1] + ctr[i] + ctr[i + 1]
    ans = max(ans, t)
print(ans)

N = int(eval(input()))
A = list(map(int, input().split()))
from collections import Counter

ctr = Counter(A)
ans = 0
for x in range(10**5 + 2):
    t = ctr[x - 1] + ctr[x] + ctr[x + 1]
    ans = max(t, ans)
print(ans)

-for i in range(10**5 + 1): -    t = ctr[i - 1] + ctr[i] + ctr[i + 1] -    ans = max(ans, t) +for x in range(10**5 + 2): +    t = ctr[x - 1] + ctr[x] + ctr[x + 1] +    ans = max(t, ans)