n=int(eval(input()))

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

count=0

a_plus=[]

a_minu=[]

for i in range(n):

    a_plus.append(a[i]+1)

    a_minu.append(a[i]-1)

import collections

a.extend(a_plus)

a.extend(a_minu)

data=collections.Counter(a)

data=sorted(list(data.items()),key=lambda x:x[1],reverse=True)

print((data[0][1]))

n=int(eval(input()))

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

from collections import Counter

plus=[0]*n

minus=[0]*n

for i in range(n):

    plus[i]=a[i]+1

    minus[i]=a[i]-1

plus=plus+minus+a

data=Counter(plus)

ans=[]

for i in list(data.values()):

    ans.append(i)

print((max(ans)))

n = int(eval(input()))
a = list(map(int, input().split()))
count = 0
a_plus = []
a_minu = []
for i in range(n):
    a_plus.append(a[i] + 1)
    a_minu.append(a[i] - 1)
import collections

a.extend(a_plus)
a.extend(a_minu)
data = collections.Counter(a)
data = sorted(list(data.items()), key=lambda x: x[1], reverse=True)
print((data[0][1]))

n = int(eval(input()))
a = list(map(int, input().split()))
from collections import Counter

plus = [0] * n
minus = [0] * n
for i in range(n):
    plus[i] = a[i] + 1
    minus[i] = a[i] - 1
plus = plus + minus + a
data = Counter(plus)
ans = []
for i in list(data.values()):
    ans.append(i)
print((max(ans)))

-count = 0 -a_plus = [] -a_minu = [] +from collections import Counter + +plus = [0] * n +minus = [0] * n -    a_plus.append(a[i] + 1) -    a_minu.append(a[i] - 1) -import collections - -a.extend(a_plus) -a.extend(a_minu) -data = collections.Counter(a) -data = sorted(list(data.items()), key=lambda x: x[1], reverse=True) -print((data[0][1])) +    plus[i] = a[i] + 1 +    minus[i] = a[i] - 1 +plus = plus + minus + a +data = Counter(plus) +ans = [] +for i in list(data.values()): +    ans.append(i) +print((max(ans)))