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 count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  }
  public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  }
} 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 count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  }
  public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  }
} Main public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  } main {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  } 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 count = 0; count 0 for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    } int num = a; int num = a; num a num <= b num b num++ num++ num {
      if (isPalindromicNumbers(num)) count++;
    } {
      if (isPalindromicNumbers(num)) count++;
    } if (isPalindromicNumbers(num)) count++; isPalindromicNumbers(num) isPalindromicNumbers num count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  } isPalindromicNumbers {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  } String strNum = Integer.toString(num); strNum Integer.toString(num) Integer.toString Integer num for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    } int i = 0; int i = 0; i 0 i < strNum.length() / 2 i strNum.length() / 2 strNum.length() strNum.length strNum 2 i++ i++ i {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    } {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    } if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false; strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1) strNum.charAt(i) strNum.charAt strNum i strNum.charAt(strNum.length() - i - 1) strNum.charAt strNum strNum.length() - i - 1 strNum.length() - i - 1 strNum.length() strNum.length strNum i 1 return false; false return true; true int num num public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  }
  public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  }
} public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int a = sc.nextInt();
    int b = sc.nextInt();
    int count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  }
  public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  }
} 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 count = 0;
    for (int num = a; num <= b; num++) {
      if (isPalindromicNumbers(num)) count++;
    }
    System.out.println(count);
  }
  public static boolean isPalindromicNumbers(int num) {
    String strNum = Integer.toString(num);
    for (int i = 0; i < strNum.length() / 2; i++) {
      if (strNum.charAt(i) != strNum.charAt(strNum.length() - i - 1)) return false;
    }
    return true;
  }
}