import bisect



N = int(eval(input()))

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

ans = 0

for i in set(A):

    l = bisect.bisect_left(A, i-1)

    r =  bisect.bisect_right(A, i+1)

    ans = max(ans, r-l)

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

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



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

for i in A:

    num[i] += 1

    num[i+1] += 1

    num[i+2] += 1



print((max(num)))
import bisect

N = int(eval(input()))
A = sorted([int(i) for i in input().split()])
ans = 0
for i in set(A):
    l = bisect.bisect_left(A, i - 1)
    r = bisect.bisect_right(A, i + 1)
    ans = max(ans, r - l)
print(ans)

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

-import bisect - -A = sorted([int(i) for i in input().split()]) -ans = 0 -for i in set(A): -    l = bisect.bisect_left(A, i - 1) -    r = bisect.bisect_right(A, i + 1) -    ans = max(ans, r - l) -print(ans) +A = [int(i) for i in input().split()] +num = [0] * (10**5 + 2) +for i in A: +    num[i] += 1 +    num[i + 1] += 1 +    num[i + 2] += 1 +print((max(num)))