import collections

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)

c=collections.Counter(a)

print((c.most_common()[0][1]))
n=int(eval(input()))

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

ans=[0]*100002

for i in a:

    ans[i]+=1

    ans[i+1]+=1

    ans[i+2]+=1

print((max(ans)))

import collections

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)
c = collections.Counter(a)
print((c.most_common()[0][1]))

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

-import collections - -for i in range(n): -    a.append(a[i] + 1) -    a.append(a[i] - 1) -c = collections.Counter(a) -print((c.most_common()[0][1])) +ans = [0] * 100002 +for i in a: +    ans[i] += 1 +    ans[i + 1] += 1 +    ans[i + 2] += 1 +print((max(ans)))