
import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  }

  static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  }

} import java.util.*; util.* java public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  }

  static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  }

} Main public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  } main {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  } @SuppressWarnings("resource")
    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++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    } {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    } cnt = isPalindromic(i) ? cnt + 1 : cnt cnt isPalindromic(i) ? cnt + 1 : cnt isPalindromic(i) isPalindromic i cnt + 1 cnt 1 cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  } isPalindromic {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  } char[] arr = String.valueOf(num).toCharArray(); arr String.valueOf(num).toCharArray() String.valueOf(num).toCharArray String.valueOf(num) String.valueOf String num for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    } int i = 0; int i = 0; i 0 i < arr.length / 2 i arr.length / 2 arr.length arr arr.length 2 i++ i++ i {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    } {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    } if (arr[i] != arr[arr.length - 1 - i])
        return false; arr[i] != arr[arr.length - 1 - i] arr[i] arr i arr[arr.length - 1 - i] arr arr.length - 1 - i arr.length - 1 - i arr.length arr arr.length 1 i return false; false return true; true int num num public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  }

  static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  }

} public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  }

  static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  }

} Main

import java.util.*;

public class Main {
  public static void main(String[] args) {
    @SuppressWarnings("resource")
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int cnt = 0;

    for (int i = A; i <= B; i++) {
      cnt = isPalindromic(i) ? cnt + 1 : cnt;
    }

    System.out.println(cnt);
  }

  static boolean isPalindromic(int num) {
    char[] arr = String.valueOf(num).toCharArray();
    for (int i = 0; i < arr.length / 2; i++) {
      if (arr[i] != arr[arr.length - 1 - i])
        return false;
    }
    return true;
  }

}
