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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      }
      if(flag) count++;
    } int i=a; int i=a; i a i<=b i b i++ i++ i {
      String n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      }
      if(flag) count++;
    } {
      String n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      }
      if(flag) count++;
    } String n = Integer.toString(i); n Integer.toString(i) Integer.toString Integer i boolean flag = true; flag true for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      } int j=0; int j=0; j 0 j<n.length()/2 j n.length()/2 n.length() n.length n 2 j++ j++ j {
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      } {
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      } char c1 = n.charAt(j); c1 n.charAt(j) n.charAt n j char c2 = n.charAt(n.length() - j -1); c2 n.charAt(n.length() - j -1) n.charAt n n.length() - j -1 n.length() - j -1 n.length() n.length n j 1 if(c1 != c2){
          flag = false;
          break;
        } c1 != c2 c1 c2 {
          flag = false;
          break;
        } flag = false flag false break; if(flag) count++; flag 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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          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 n = Integer.toString(i);
      boolean flag = true;
      for(int j=0;j<n.length()/2;j++){
        char c1 = n.charAt(j);
        char c2 = n.charAt(n.length() - j -1);
        if(c1 != c2){
          flag = false;
          break;
        }
      }
      if(flag) count++;
    }
    System.out.println(count);
  }
}
