N = int(eval(input()))



import collections

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

b = [[0] * 3 for i in range(N)]

A = [] * 3 * N

for i in range(len(a)):

    b[i][0] = a[i] - 1

    b[i][1] = a[i]

    b[i][2] = a[i] + 1

    A.append(a[i] - 1)

    A.append(a[i])

    A.append(a[i] + 1)



c = collections.Counter(A)

ans = c.most_common()[0][1]

print(ans)

N = int(eval(input()))



import collections

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

A = [] * 3 * N

for i in range(len(a)):

    A.append(a[i] - 1)

    A.append(a[i])

    A.append(a[i] + 1)



c = collections.Counter(A)

ans = c.most_common()[0][1]

print(ans)

N = int(eval(input()))
import collections

a = list(map(int, input().split()))
b = [[0] * 3 for i in range(N)]
A = [] * 3 * N
for i in range(len(a)):
    b[i][0] = a[i] - 1
    b[i][1] = a[i]
    b[i][2] = a[i] + 1
    A.append(a[i] - 1)
    A.append(a[i])
    A.append(a[i] + 1)
c = collections.Counter(A)
ans = c.most_common()[0][1]
print(ans)

N = int(eval(input()))
import collections

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

-b = [[0] * 3 for i in range(N)] -    b[i][0] = a[i] - 1 -    b[i][1] = a[i] -    b[i][2] = a[i] + 1