import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } String value = "" + i; value "" + i "" i StringBuilder builder = new StringBuilder(); builder new StringBuilder() builder.append(value) builder.append builder value builder.reverse() builder.reverse builder if (value.equals(builder.toString())) {
            ans++;
          } value.equals(builder.toString()) value.equals value builder.toString() builder.toString builder {
            ans++;
          } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	}
} Main
import java.util.*;
public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
    
		// 文字列の入力
		int a = sc.nextInt();
        int b = sc.nextInt();
        int ans = 0;
       
        for(int i = a; i <= b; i++) {
          String value = "" + i;
          StringBuilder builder = new StringBuilder();
          builder.append(value);
          builder.reverse();
          if (value.equals(builder.toString())) {
            ans++;
          }
        } 
    
		// 出力
		System.out.println(ans);
	}
}
