n = int(input()) a = [int(input()) for i in range(n)] ans = 1 a.sort(reverse=True) for i in range(n-1): if a[i]-a[i+1] == 1: ans += 1 break print(ans)