from collections import Counter

n = int(eval(input()))

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

c = Counter(a)

ans = 0

for x in range(min(a), max(a)+1):

  res = c[x] + c[x+1] + c[x-1]

  ans = max(ans, res)

print(ans)
n=int(eval(input()))

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

data=[0]*(10**5+2)

for i in a:

  data[i]+=1

  data[i+1]+=1

  data[i+2]+=1

print((max(data)))
from collections import Counter

n = int(eval(input()))
a = list(map(int, input().split()))
c = Counter(a)
ans = 0
for x in range(min(a), max(a) + 1):
    res = c[x] + c[x + 1] + c[x - 1]
    ans = max(ans, res)
print(ans)

n = int(eval(input()))
a = list(map(int, input().split()))
data = [0] * (10**5 + 2)
for i in a:
    data[i] += 1
    data[i + 1] += 1
    data[i + 2] += 1
print((max(data)))

-from collections import Counter - -c = Counter(a) -ans = 0 -for x in range(min(a), max(a) + 1): -    res = c[x] + c[x + 1] + c[x - 1] -    ans = max(ans, res) -print(ans) +data = [0] * (10**5 + 2) +for i in a: +    data[i] += 1 +    data[i + 1] += 1 +    data[i + 2] += 1 +print((max(data)))