from collections import defaultdict



n = int(eval(input()))

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

frequency = defaultdict(int)



for n in nums:

    for x in [-1, 0, 1]:

        if 0 <= n + x and n + x <= 10 **5:

            frequency[n + x] += 1



ans = 0

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

    ans = max(ans, v)



print(ans)

from collections import defaultdict



n = int(eval(input()))

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

d = defaultdict(int)



for num in numbers:

    for x in [-1, 0, 1]:

        if num + x >= 0:

            d[num + x] += 1



ans = 0

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

    ans = max(ans, v)



print(ans)
from collections import defaultdict

n = int(eval(input()))
nums = list(map(int, input().split()))
frequency = defaultdict(int)
for n in nums:
    for x in [-1, 0, 1]:
        if 0 <= n + x and n + x <= 10**5:
            frequency[n + x] += 1
ans = 0
for k, v in list(frequency.items()):
    ans = max(ans, v)
print(ans)

from collections import defaultdict

n = int(eval(input()))
numbers = list(map(int, input().split()))
d = defaultdict(int)
for num in numbers:
    for x in [-1, 0, 1]:
        if num + x >= 0:
            d[num + x] += 1
ans = 0
for k, v in list(d.items()):
    ans = max(ans, v)
print(ans)

-nums = list(map(int, input().split())) -frequency = defaultdict(int) -for n in nums: +numbers = list(map(int, input().split())) +d = defaultdict(int) +for num in numbers: -        if 0 <= n + x and n + x <= 10**5: -            frequency[n + x] += 1 +        if num + x >= 0: +            d[num + x] += 1 -for k, v in list(frequency.items()): +for k, v in list(d.items()):