import java.util.*;

public class Main {

  public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-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);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  }
} Main public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  } main {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String input = sc.nextLine(); input sc.nextLine() sc.nextLine sc String[] inputs = input.split(" "); inputs input.split(" ") input.split input " " int low = Integer.valueOf(inputs[0]); low Integer.valueOf(inputs[0]) Integer.valueOf Integer inputs[0] inputs 0 int high  = Integer.valueOf(inputs[1]); high Integer.valueOf(inputs[1]) Integer.valueOf Integer inputs[1] inputs 1 int count = 0 ; count 0 for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        } int i = low; int i = low; i low i<=high i high i++ i++ i {
          	if ( checkPalindrome(i)){
            	count++;
            }
        } {
          	if ( checkPalindrome(i)){
            	count++;
            }
        } if ( checkPalindrome(i)){
            	count++;
            } checkPalindrome(i) checkPalindrome i {
            	count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String args[] args private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  } checkPalindrome {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  } String numString = String.valueOf(num); numString String.valueOf(num) String.valueOf String num int length = numString.length(); length numString.length() numString.length numString int parseLength = length%2==0?length/2:length/2+1; parseLength length%2==0?length/2:length/2+1 length%2==0 length%2 length 2 0 length/2 length 2 length/2+1 length/2 length 2 1 for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        } int i = 0 ; int i = 0 ; i 0 i<parseLength i parseLength i++ i++ i {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        } {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        } if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false; !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i)) numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i)) numString.substring(i,i+1).equals numString.substring(i,i+1) numString.substring numString i i+1 i 1 numString.substring(length-i-1,length-i) numString.substring numString length-i-1 length-i-1 length i 1 length-i length i return false; false return true; true int num num public class Main {

  public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  }
} public class Main {

  public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  }
} Main
import java.util.*;

public class Main {

  public static void main(String args[])
  {
    	Scanner sc = new Scanner(System.in);
    	String input = sc.nextLine();
    	String[] inputs = input.split(" ");
    	int low = Integer.valueOf(inputs[0]);
    	int high  = Integer.valueOf(inputs[1]);
    	int count = 0 ;
		for( int i = low; i<=high ; i++) {
          	if ( checkPalindrome(i)){
            	count++;
            }
        }
    	System.out.println(count);	
  }
  
  private static boolean checkPalindrome(int num) {
    	String numString = String.valueOf(num);
    	int length = numString.length();
    	int parseLength = length%2==0?length/2:length/2+1;
    	
    	for( int i = 0 ; i<parseLength ; i++ ) {
        	if( !numString.substring(i,i+1).equals(numString.substring(length-i-1,length-i))) 
        		return false;
        }
        return true;
    
    
  }
}