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 (check(i)) ans++;
    }
    System.out.println(ans);
  }
  
  private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); 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 (check(i)) ans++;
    }
    System.out.println(ans);
  }
  
  private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); 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 (check(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 (check(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 (check(i)) ans++;
    } int i = A; int i = A; i A i <= B i B i++ i++ i {
      if (check(i)) ans++;
    } {
      if (check(i)) ans++;
    } if (check(i)) ans++; check(i) check i ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  } check {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  } String s = String.valueOf(num); s String.valueOf(num) String.valueOf String num for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    } int i = 0; int i = 0; i 0 i < s.length() i s.length() s.length s 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 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 ans = 0;
    for (int i = A; i <= B; i++) {
      if (check(i)) ans++;
    }
    System.out.println(ans);
  }
  
  private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); 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 (check(i)) ans++;
    }
    System.out.println(ans);
  }
  
  private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); 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 (check(i)) ans++;
    }
    System.out.println(ans);
  }
  
  private static boolean check(int num) {
    String s = String.valueOf(num);
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) != s.charAt(s.length() - 1 - i)) {
        return false;
      }
    }
    return true;
  }
}