from collections import Counter

eval(input())

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

C = Counter(A)

def get(i): return C[i] if i in C else 0

print((max(sum(get(x) for x in range(i-1,i+2)) for i in range(10**5))))
N,*A=list(map(int, open(0).read().split()))

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

for a in A:

    C[a-1]+=1

    C[a]+=1

    C[a+1]+=1

print((max(C[i] for i in range(10**5+1))))

from collections import Counter

eval(input())
A = list(map(int, input().split()))
C = Counter(A)


def get(i):
    return C[i] if i in C else 0


print((max(sum(get(x) for x in range(i - 1, i + 2)) for i in range(10**5))))

N, *A = list(map(int, open(0).read().split()))
C = [0] * (10**5 + 5)
for a in A:
    C[a - 1] += 1
    C[a] += 1
    C[a + 1] += 1
print((max(C[i] for i in range(10**5 + 1))))

-from collections import Counter - -eval(input()) -A = list(map(int, input().split())) -C = Counter(A) - - -def get(i): -    return C[i] if i in C else 0 - - -print((max(sum(get(x) for x in range(i - 1, i + 2)) for i in range(10**5)))) +N, *A = list(map(int, open(0).read().split())) +C = [0] * (10**5 + 5) +for a in A: +    C[a - 1] += 1 +    C[a] += 1 +    C[a + 1] += 1 +print((max(C[i] for i in range(10**5 + 1))))