import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
} import java.util.Scanner; Scanner 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 cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
} Main public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  } main {

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  } 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 cnt = 0; cnt 0 for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    } int i = a; int i = a; i a i <= b i b i++ i++ i {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    } {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    } String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i StringBuilder bld = new StringBuilder(s.substring(3)); bld new StringBuilder(s.substring(3)) String rev = bld.reverse().toString(); rev bld.reverse().toString() bld.reverse().toString bld.reverse() bld.reverse bld if (s.substring(0, 2).equals(rev)) {
        cnt++;
      } s.substring(0, 2).equals(rev) s.substring(0, 2).equals s.substring(0, 2) s.substring s 0 2 rev {
        cnt++;
      } cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt 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 cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
} public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {

    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int cnt = 0;

    for (int i = a; i <= b; i++) {
      String s = Integer.toString(i);
      StringBuilder bld = new StringBuilder(s.substring(3));
      String rev = bld.reverse().toString();
      if (s.substring(0, 2).equals(rev)) {
        cnt++;
      }
    }

    System.out.println(cnt);

  }
}