#ABC 072 C

N=int(eval(input()))

A=[int(j) for j in input().split()]

cnt=[0]*(10**6)

for a in A:

    cnt[a]+=1

    cnt[a+1]+=1

    cnt[a+2]+=1

print((max(cnt)))
#ABC 072 C

N=int(eval(input()))

A=[int(j) for j in input().split()]

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

for a in A:

    cnt[a]+=1

    cnt[a+1]+=1

    cnt[a+2]+=1

print((max(cnt)))
# ABC 072 C
N = int(eval(input()))
A = [int(j) for j in input().split()]
cnt = [0] * (10**6)
for a in A:
    cnt[a] += 1
    cnt[a + 1] += 1
    cnt[a + 2] += 1
print((max(cnt)))

# ABC 072 C
N = int(eval(input()))
A = [int(j) for j in input().split()]
cnt = [0] * (10**5 + 10)
for a in A:
    cnt[a] += 1
    cnt[a + 1] += 1
    cnt[a + 2] += 1
print((max(cnt)))

-cnt = [0] * (10**6) +cnt = [0] * (10**5 + 10)