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 count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
} 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 count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
} Main public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  } 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 count = 0; count 0 for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    } int i = a; int i = a; i a i <= b i b i++ i++ i {
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    } {
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    } String str = String.valueOf(i); str String.valueOf(i) String.valueOf String i boolean flag = true; flag true for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      } int j = 0; int j = 0; j 0 j < str.length() / 2 j str.length() / 2 str.length() str.length str 2 j++ j++ j {
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      } {
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      } if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        } str.charAt(j) != str.charAt(str.length() - 1 - j) str.charAt(j) str.charAt str j str.charAt(str.length() - 1 - j) str.charAt str str.length() - 1 - j str.length() - 1 - j str.length() str.length str 1 j {
          flag = false;
          break;
        } flag = false flag false break; if(flag){
        count++;
      } flag {
        count++;
      } count++ count System.out.println(count) System.out.println System.out System System.out count 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 count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
} public class Main{
  public static void main(String[] args){
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
} 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 count = 0;
    for(int i = a; i <= b; i++){
      String str = String.valueOf(i);
      boolean flag = true;
      for(int j = 0; j < str.length() / 2; j++){
        if(str.charAt(j) != str.charAt(str.length() - 1 - j)){
          flag = false;
          break;
        }
      }
      if(flag){
        count++;
      }
    }
    System.out.println(count);
  }
}