https://www.acmicpc.net/problem/1065
x=int(input()) count=99 if x<100: print(x) else: for i in range(100,x+1): a=i%10 b=int(i/10)%10 c=int(int(i/10)/10) if c-b==b-a: count+=1 print(count)