import java.util.*;

public class Main {
	static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    }
    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(reverse(i)) ans++; 
		}
		System.out.println(ans); 
	}
} import java.util.*; util.* java public class Main {
	static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    }
    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(reverse(i)) ans++; 
		}
		System.out.println(ans); 
	}
} Main static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    } reverse {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    } int k =n; k n int rev = 0; rev 0 while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      } n!=0 n 0 {
        rev = rev*10+n%10;
        n /=10;
      } rev = rev*10+n%10 rev rev*10+n%10 rev*10 rev 10 n%10 n 10 n /=10 n 10 if(k==rev){
        return true;
      }
      else{
        return false;
      } k==rev k rev {
        return true;
      } return true; true {
        return false;
      } return false; false int n n 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(reverse(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(reverse(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(reverse(i)) ans++; 
		} int i = a; int i = a; i a i<= b i b i++ i++ i {
			if(reverse(i)) ans++; 
		} {
			if(reverse(i)) ans++; 
		} if(reverse(i)) ans++; reverse(i) reverse i ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    }
    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(reverse(i)) ans++; 
		}
		System.out.println(ans); 
	}
} public class Main {
	static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    }
    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(reverse(i)) ans++; 
		}
		System.out.println(ans); 
	}
} Main
import java.util.*;

public class Main {
	static boolean reverse(int n) {
      int k =n;
      int rev = 0;
      while(n!=0){
        rev = rev*10+n%10;
        n /=10;
      }
      if(k==rev){
        return true;
      }
      else{
        return false;
      }
    }
    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(reverse(i)) ans++; 
		}
		System.out.println(ans); 
	}
}