n=int(eval(input()))

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

f=max(g)

l=[0]*(f+2)

for i in g:

  for j in range(max(0,i-1),min(i+2,f+1)):

    l[j]+=1

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

from collections import Counter as co

var=co(list(map(int,input().split())))

ans=0

for k in var:

  p=var[k]

  if k-1 in var:p+=var[k-1]

  if k+1 in var:p+=var[k+1]

  

  ans=max(ans,p)

print(ans)
n = int(eval(input()))
g = list(map(int, input().split()))
f = max(g)
l = [0] * (f + 2)
for i in g:
    for j in range(max(0, i - 1), min(i + 2, f + 1)):
        l[j] += 1
print((max(l)))

n = int(eval(input()))
from collections import Counter as co

var = co(list(map(int, input().split())))
ans = 0
for k in var:
    p = var[k]
    if k - 1 in var:
        p += var[k - 1]
    if k + 1 in var:
        p += var[k + 1]
    ans = max(ans, p)
print(ans)

-g = list(map(int, input().split())) -f = max(g) -l = [0] * (f + 2) -for i in g: -    for j in range(max(0, i - 1), min(i + 2, f + 1)): -        l[j] += 1 -print((max(l))) +from collections import Counter as co + +var = co(list(map(int, input().split()))) +ans = 0 +for k in var: +    p = var[k] +    if k - 1 in var: +        p += var[k - 1] +    if k + 1 in var: +        p += var[k + 1] +    ans = max(ans, p) +print(ans)