input();a=[0]*100000
for i in input().split():a[int(i)]+=1
print(max(map(sum,zip(a,a[1:],a[2:]))))
4778e4e980c0ca3a24fa3a6e35506c46332bdb60
<mask token>

input()
<mask token>
for i in input().split():
    a[int(i)] += 1
print(max(map(sum, zip(a, a[1:], a[2:]))))

input()
a = [0] * 100000
for i in input().split():
    a[int(i)] += 1
print(max(map(sum, zip(a, a[1:], a[2:]))))

input();a=[0]*100000
for i in input().split():a[int(i)]+=1
print(max(map(sum,zip(a,a[1:],a[2:]))))