n  = int(eval(input()))

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

ls_plus1  = list([x + 1 for x in ls])

ls_minus1 = list([x - 1 for x in ls])

dic = {}

for a in ls_minus1 + ls + ls_plus1:

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

print((sorted(dic.values())[-1]))

    
n  = int(eval(input()))

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

ls_plus1  = list([x + 1 for x in ls])

ls_minus1 = list([x - 1 for x in ls])

dic = {}

for a in ls_minus1 + ls + ls_plus1:

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

print((max(dic.values())))

    
n = int(eval(input()))
ls = list(map(int, input().split()))
ls_plus1 = list([x + 1 for x in ls])
ls_minus1 = list([x - 1 for x in ls])
dic = {}
for a in ls_minus1 + ls + ls_plus1:
    dic[a] = dic.get(a, 0) + 1
print((sorted(dic.values())[-1]))

n = int(eval(input()))
ls = list(map(int, input().split()))
ls_plus1 = list([x + 1 for x in ls])
ls_minus1 = list([x - 1 for x in ls])
dic = {}
for a in ls_minus1 + ls + ls_plus1:
    dic[a] = dic.get(a, 0) + 1
print((max(dic.values())))

-print((sorted(dic.values())[-1])) +print((max(dic.values())))