from itertools import accumulate

n = int(eval(input()))

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

a = [i+1 for i in a]



imos = [0] * (10**5 + 3)



for i in a:

    imos[i-1] += 1

    imos[i+2] -= 1



i = accumulate(imos)

print((max(i)))

N = int(eval(input()))

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

A = [i + 1 for i in A]



bucket = [0] * (10 ** 5 + 10)



for a in A:

    bucket[a - 1] += 1

    bucket[a] += 1

    bucket[a+1] += 1



print((max(bucket)))
from itertools import accumulate

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

N = int(eval(input()))
A = list(map(int, input().split()))
A = [i + 1 for i in A]
bucket = [0] * (10**5 + 10)
for a in A:
    bucket[a - 1] += 1
    bucket[a] += 1
    bucket[a + 1] += 1
print((max(bucket)))

-from itertools import accumulate - -n = int(eval(input())) -a = list(map(int, input().split())) -a = [i + 1 for i in a] -imos = [0] * (10**5 + 3) -for i in a: -    imos[i - 1] += 1 -    imos[i + 2] -= 1 -i = accumulate(imos) -print((max(i))) +N = int(eval(input())) +A = list(map(int, input().split())) +A = [i + 1 for i in A] +bucket = [0] * (10**5 + 10) +for a in A: +    bucket[a - 1] += 1 +    bucket[a] += 1 +    bucket[a + 1] += 1 +print((max(bucket)))