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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) ans++;
    } int i = a; int i = a; i a i <= b i b i++ i++ i {
      String s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) ans++;
    } {
      String s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) ans++;
    } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i int p = 0; p 0 for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      } int j = 0; int j = 0; j 0 j < s.length() j s.length() s.length s j++ j++ j {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      } {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      } if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++; s.charAt(j) != s.charAt(s.length() - 1 - j) s.charAt(j) s.charAt s j s.charAt(s.length() - 1 - j) s.charAt s s.length() - 1 - j s.length() - 1 - j s.length() s.length s 1 j p++ p if(p == 0) ans++; p == 0 p 0 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) 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 s = String.valueOf(i);
      int p = 0;
      for(int j = 0; j < s.length(); j++) {
        if(s.charAt(j) != s.charAt(s.length() - 1 - j)) p++;
      }
      if(p == 0) ans++;
    }
    System.out.println(ans);
  }
}