#Yechim
n = int(input())
ls = list(map(int,input().split()))
ls.sort()
i = 0
teams = 0
if ls[-1]-ls[0] == n-1 and ls == list(range(ls[0],ls[-1]+1)):
teams = n//3
while i + 2 < n:
if ls[i+2] - ls[i]
n = int(input())
ls = list(map(int,input().split()))
ls.sort()
i = 0
teams = 0
if ls[-1]-ls[0] == n-1 and ls == list(range(ls[0],ls[-1]+1)):
teams = n//3
while i + 2 < n:
if ls[i+2] - ls[i]