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 tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  }

  private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  }
} 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 tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  }

  private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  }
} Main public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  } main {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  } 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 tot = 0; tot 0 for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      if (palindromic(i)) tot++;
    } {
      if (palindromic(i)) tot++;
    } if (palindromic(i)) tot++; palindromic(i) palindromic i tot++ tot System.out.println(tot) System.out.println System.out System System.out tot String[] args args private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  } palindromic {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  } char[] s = Integer.toString(n).toCharArray(); s Integer.toString(n).toCharArray() Integer.toString(n).toCharArray Integer.toString(n) Integer.toString Integer n int i = 0; i 0 int j = s.length - 1; j s.length - 1 s.length s s.length 1 while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    } i < j i j {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    } if (s[i] != s[j]) return false; s[i] != s[j] s[i] s i s[j] s j return false; false i++ i j-- j return true; true int n n public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  }

  private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner scanner = new Scanner(System.in);

    int A = scanner.nextInt();
    int B = scanner.nextInt();
    int tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  }

  private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  }
} 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 tot = 0;
    for (int i = A; i <= B; i++) {
      if (palindromic(i)) tot++;
    }
    System.out.println(tot);
  }

  private static boolean palindromic(int n) {
    char[] s = Integer.toString(n).toCharArray();
    int i = 0;
    int j = s.length - 1;
    while (i < j) {
      if (s[i] != s[j]) return false;
      i++;
      j--;
    }
    return true;
  }
}
