문제 링크 - https://www.acmicpc.net/problem/1065
n = int(input())
cnt = 0
if len(str(n)) > 2:
cnt = 99
for number in range(100, n+1):
check = int(str(number)[0]) - int(str(number)[1])
for i in range(1, len(str(number))-1):
if int(str(number)[i]) - int(str(number)[i+1]) == check:
continue
else:
break
else:
cnt += 1
print(cnt)
else:
print(n)