https://www.acmicpc.net/problem/1065
import java.util.Scanner;
public class Main {
public static void main(String args[]) {
Scanner s=new Scanner(System.in);
int x=s.nextInt();
int count=99;
if(x<100) System.out.print(x);
else{
for(int i=100;i<=x;i++){
int a=i%10;
int b=(i/10)%10;
int c=(i/10)/10;
if(c-b==b-a) count++;
}
System.out.print(count);
}
}
}