n=int(input())
a=[int(input()) for _ in range(n)]
a.sort()
c=[0]*n
for i in range(1,n):
	if a[i]-a[i-1]<2:
		print(2)
		break
else:
	print(1)