#!/bin/python3 import sys n = int(input().strip()) a = [int(a_temp) for a_temp in input().strip().split(' ')] a.sort() m=0 t=0 f=0 l=0 v=a[0] for i in a: if v!=i: if l==v-1 and mm: m=f l=v t=f f=0 v=i if i==v: f+=1 if l==v-1 and mm: m=f print(m)