import java.util.*;
class Main{

     public static void main(String []args){
        //System.out.println("Hello World");
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int count2 = 0 ;
        for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        }
        
        System.out.println(count2);
     }
} import java.util.*; util.* java class Main{

     public static void main(String []args){
        //System.out.println("Hello World");
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int count2 = 0 ;
        for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        }
        
        System.out.println(count2);
     }
} Main public static void main(String []args){
        //System.out.println("Hello World");
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int count2 = 0 ;
        for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        }
        
        System.out.println(count2);
     } main {
        //System.out.println("Hello World");
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int count2 = 0 ;
        for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        }
        
        System.out.println(count2);
     } Scanner scan = new Scanner(System.in); scan new Scanner(System.in) int x = scan.nextInt(); x scan.nextInt() scan.nextInt scan int y = scan.nextInt(); y scan.nextInt() scan.nextInt scan int count2 = 0 ; count2 0 for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        } int i = x ; int i = x ; i x i<=y i y i++ i++ i {
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        } {
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        } int k = 1 ; k 1 int count = 0 ; count 0 char[] arr = String.valueOf(i).toCharArray(); arr String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            } int j= 0 ; int j= 0 ; j 0 j<=arr.length/2 j arr.length/2 arr.length arr arr.length 2 j++ j++ j {
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            } {
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            } if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                } arr[j] == arr[arr.length-k] arr[j] arr j arr[arr.length-k] arr arr.length-k arr.length arr arr.length k {
                    count++ ; 
                } count++ count k++ k if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            } count == Math.ceil(arr.length/2.0) count Math.ceil(arr.length/2.0) Math.ceil Math arr.length/2.0 arr.length arr arr.length 2.0 {
                count2++ ;
            } count2++ count2 System.out.println(count2) System.out.println System.out System System.out count2 String []args args
import java.util.*;
class Main{

     public static void main(String []args){
        //System.out.println("Hello World");
        Scanner scan = new Scanner(System.in);
        int x = scan.nextInt();
        int y = scan.nextInt();
        int count2 = 0 ;
        for(int i = x ; i<=y ;i++){
            int k = 1 ;
            int count = 0 ;
            char[] arr = String.valueOf(i).toCharArray();
            for(int j= 0 ; j<=arr.length/2 ; j++){
                
                if(arr[j] == arr[arr.length-k]){
                    count++ ; 
                }
                k++;
            }
            if(count == Math.ceil(arr.length/2.0)){
                count2++ ;
            }
        }
        
        System.out.println(count2);
     }
}