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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  }
  private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  }
  private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  } main {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  } 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 ans = 0; ans 0 for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      if (isPalindromic(i)) {
        ans++;
      }
    } {
      if (isPalindromic(i)) {
        ans++;
      }
    } if (isPalindromic(i)) {
        ans++;
      } isPalindromic(i) isPalindromic i {
        ans++;
      } ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  } isPalindromic {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  } String s = String.valueOf(n); s String.valueOf(n) String.valueOf String n for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    } int i = 0; int i = 0; i 0 i < s.length()/2 i s.length()/2 s.length() s.length s 2 i++ i++ i {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    } {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    } if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      } s.charAt(i) != s.charAt(s.length() - 1 - i) s.charAt(i) s.charAt s i s.charAt(s.length() - 1 - i) s.charAt s s.length() - 1 - i s.length() - 1 - i s.length() s.length s 1 i {
        return false;
      } return false; false return true; true int n n public class Main {
  public static void main(String[] args) {
    Scanner sc = new Scanner(System.in);
    int A = sc.nextInt();
    int B = sc.nextInt();
    int ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  }
  private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  }
  private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (isPalindromic(i)) {
        ans++;
      }
    }
    System.out.println(ans);
  }
  private static boolean isPalindromic(int n) {
    String s = String.valueOf(n);
    for (int i = 0; i < s.length()/2; i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  }
}