yuchen
n = int(input())
positions = list(map(int, input().split()))
has_tree = [0] * 21
for p in positions:
has_tree[p] = 1
max_count = 0
for i in range(0, 18):
count = sum(has_tree[i:i+4])
if count > max_count:
max_count = count
print(max_count)
vivian
n=int(input())
n1=list(map(int,input().split()))
ls=[0]*21
ma=0
for i in n1:
ls[i]=1
for i in range(3,21):
ma=max(ma,sum(ls[i-3:i+1]))
print(ma)