from collections import Counter



N=int(eval(input()))

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



b=[x+1for x in a]

c=[x-1for x in a]



d=a+b+c



print((max(Counter(d).values())))
N=int(eval(input()))

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



count = [0]*100002



for a in a_list:

    count[a] += 1

    count[a+1] += 1

    count[a+2] += 1

    

print((max(count)))

from collections import Counter

N = int(eval(input()))
a = list(map(int, input().split()))
b = [x + 1 for x in a]
c = [x - 1 for x in a]
d = a + b + c
print((max(Counter(d).values())))

N = int(eval(input()))
a_list = list(map(int, input().split()))
count = [0] * 100002
for a in a_list:
    count[a] += 1
    count[a + 1] += 1
    count[a + 2] += 1
print((max(count)))

-from collections import Counter - -a = list(map(int, input().split())) -b = [x + 1 for x in a] -c = [x - 1 for x in a] -d = a + b + c -print((max(Counter(d).values()))) +a_list = list(map(int, input().split())) +count = [0] * 100002 +for a in a_list: +    count[a] += 1 +    count[a + 1] += 1 +    count[a + 2] += 1 +print((max(count)))