n=int(eval(input()))

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



dic={}

for v in al:

    if not v in list(dic.keys()):

        dic[v]=1

    else:

        dic[v]=dic[v]+1

count_l=[]

for v in range(min(al)-1,max(al)+2):

    count=0

    count=dic.get(v-1,0)+dic.get(v,0)+dic.get(v+1,0)

    count_l.append(count)

print((max(count_l)))
n = int(eval(input()))

#a, b = map(int,input().split())

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

#l = [list(map(int,input().split())) for i in range(n)]



dic = {}

for a in al:

    dic[a] = dic.get(a, 0)+1



mx = max(al)

mn = min(al)

ans = 0

for x in range(mn, mx+1):

    ans = max(ans, dic.get(x+1, 0)+dic.get(x, 0)+dic.get(x-1, 0))

print(ans)

n = int(eval(input()))
al = list(map(int, input().split()))
dic = {}
for v in al:
    if not v in list(dic.keys()):
        dic[v] = 1
    else:
        dic[v] = dic[v] + 1
count_l = []
for v in range(min(al) - 1, max(al) + 2):
    count = 0
    count = dic.get(v - 1, 0) + dic.get(v, 0) + dic.get(v + 1, 0)
    count_l.append(count)
print((max(count_l)))

n = int(eval(input()))
# a, b = map(int,input().split())
al = list(map(int, input().split()))
# l = [list(map(int,input().split())) for i in range(n)]
dic = {}
for a in al:
    dic[a] = dic.get(a, 0) + 1
mx = max(al)
mn = min(al)
ans = 0
for x in range(mn, mx + 1):
    ans = max(ans, dic.get(x + 1, 0) + dic.get(x, 0) + dic.get(x - 1, 0))
print(ans)

+# a, b = map(int,input().split()) +# l = [list(map(int,input().split())) for i in range(n)] -for v in al: -    if not v in list(dic.keys()): -        dic[v] = 1 -    else: -        dic[v] = dic[v] + 1 -count_l = [] -for v in range(min(al) - 1, max(al) + 2): -    count = 0 -    count = dic.get(v - 1, 0) + dic.get(v, 0) + dic.get(v + 1, 0) -    count_l.append(count) -print((max(count_l))) +for a in al: +    dic[a] = dic.get(a, 0) + 1 +mx = max(al) +mn = min(al) +ans = 0 +for x in range(mn, mx + 1): +    ans = max(ans, dic.get(x + 1, 0) + dic.get(x, 0) + dic.get(x - 1, 0)) +print(ans)