import java.util.*;
import java.util.Collections;
import java.util.stream.Collectors;

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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    }
    System.out.println(cnt);
  }
} import java.util.*; util.* java import java.util.Collections; Collections java.util import java.util.stream.Collectors; Collectors java.util.stream 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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      String C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    } {
      String C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    } String C = String.valueOf(i); C String.valueOf(i) String.valueOf String i String D = C.substring(0, 1); D C.substring(0, 1) C.substring C 0 1 String E = C.substring(C.length() - 1, C.length()); E C.substring(C.length() - 1, C.length()) C.substring C C.length() - 1 C.length() C.length C 1 C.length() C.length C String F = C.substring(1, 2); F C.substring(1, 2) C.substring C 1 2 String G = C.substring(C.length() - 2, C.length() - 1); G C.substring(C.length() - 2, C.length() - 1) C.substring C C.length() - 2 C.length() C.length C 2 C.length() - 1 C.length() C.length C 1 if (D.equals(E) && F.equals(G)) {
        cnt++;
      } D.equals(E) && F.equals(G) D.equals(E) D.equals D E F.equals(G) F.equals F G {
        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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    }
    System.out.println(cnt);
  }
} Main
import java.util.*;
import java.util.Collections;
import java.util.stream.Collectors;

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 C = String.valueOf(i);
      String D = C.substring(0, 1);
      String E = C.substring(C.length() - 1, C.length());
      String F = C.substring(1, 2);
      String G = C.substring(C.length() - 2, C.length() - 1);
      if (D.equals(E) && F.equals(G)) {
        cnt++;
      }
    }
    System.out.println(cnt);
  }
}
