from collections import Counter



N = int(eval(input()))

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



for i in range(N):

    a.append(a[i]+1)

    a.append(a[i]-1)



ans = Counter(a)



print((ans.most_common()[0][1]))
from collections import defaultdict



n = int(eval(input()))

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



d = defaultdict(int)



for x in arr:

    d[x] += 1

    d[x - 1] += 1

    d[x + 1] += 1



result = [y for x, y in list(d.items())]



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

N = int(eval(input()))
a = list(map(int, input().split()))
for i in range(N):
    a.append(a[i] + 1)
    a.append(a[i] - 1)
ans = Counter(a)
print((ans.most_common()[0][1]))

from collections import defaultdict

n = int(eval(input()))
arr = list(map(int, input().split()))
d = defaultdict(int)
for x in arr:
    d[x] += 1
    d[x - 1] += 1
    d[x + 1] += 1
result = [y for x, y in list(d.items())]
print((max(result)))

-from collections import Counter +from collections import defaultdict -N = int(eval(input())) -a = list(map(int, input().split())) -for i in range(N): -    a.append(a[i] + 1) -    a.append(a[i] - 1) -ans = Counter(a) -print((ans.most_common()[0][1])) +n = int(eval(input())) +arr = list(map(int, input().split())) +d = defaultdict(int) +for x in arr: +    d[x] += 1 +    d[x - 1] += 1 +    d[x + 1] += 1 +result = [y for x, y in list(d.items())] +print((max(result)))