from collections import Counter

N = int(eval(input()))

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

counter = Counter(a)

ans=[]

for k,v in list(counter.items()):

    if k-1 in counter:

        v+=counter[k-1]

    if k+1 in counter:

        v+=counter[k+1]

    ans.append(v)

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

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

c = [0] * (max(a)+3)

for v in a:

    c[v] += 1

    c[v+1] += 1

    c[v+2] += 1

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

N = int(eval(input()))
a = list(map(int, input().split()))
counter = Counter(a)
ans = []
for k, v in list(counter.items()):
    if k - 1 in counter:
        v += counter[k - 1]
    if k + 1 in counter:
        v += counter[k + 1]
    ans.append(v)
print((max(ans)))

n = int(eval(input()))
a = list(map(int, input().split()))
c = [0] * (max(a) + 3)
for v in a:
    c[v] += 1
    c[v + 1] += 1
    c[v + 2] += 1
print((max(c)))

-from collections import Counter - -N = int(eval(input())) +n = int(eval(input())) -counter = Counter(a) -ans = [] -for k, v in list(counter.items()): -    if k - 1 in counter: -        v += counter[k - 1] -    if k + 1 in counter: -        v += counter[k + 1] -    ans.append(v) -print((max(ans))) +c = [0] * (max(a) + 3) +for v in a: +    c[v] += 1 +    c[v + 1] += 1 +    c[v + 2] += 1 +print((max(c)))