import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  }

} import java.util.Scanner; Scanner java.util public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  }

} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  } main {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int A = scanner.nextInt(); A scanner.nextInt() scanner.nextInt scanner int B = scanner.nextInt(); B scanner.nextInt() scanner.nextInt scanner int total = 0; total 0 for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    } {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    } String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i StringBuffer sb = new StringBuffer(s); sb new StringBuffer(s) String r = new String(sb.reverse()); r new String(sb.reverse()) if (s.equals(r)) {
        total++;
      } s.equals(r) s.equals s r {
        total++;
      } total++ total System.out.println(total) System.out.println System.out System System.out total String[] args args public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  }

} public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  }

} Main
import java.util.Scanner;

public class Main {

  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();

    int total = 0;
    for (int i = A; i <= B; i++) {
      String s = String.valueOf(i);
      StringBuffer sb = new StringBuffer(s);
      String r = new String(sb.reverse());
      if (s.equals(r)) {
        total++;
      }
    }
    System.out.println(total);

  }

}
