import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); }
		  } import java.util.Scanner; Scanner java.util public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); }
		  } Main public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); } main {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); } Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int A = scanner.nextInt(); A scanner.nextInt() scanner.nextInt scanner int B = scanner.nextInt(); B scanner.nextInt() scanner.nextInt scanner int counter = 0; counter 0 for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    } int i = 0; int i = 0; i 0 i <= B - A i B - A B A i++ i++ i {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    } {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    } if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	} ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ((A + i) /10000) % 10 == (A + i)% 10 ((A + i) /10000) % 10 ((A + i) /10000) (A + i) A i 10000 10 (A + i)% 10 (A + i) A i 10 ((A + i) /1000) % 10 == ((A + i) /10) % 10 ((A + i) /1000) % 10 ((A + i) /1000) (A + i) A i 1000 10 ((A + i) /10) % 10 ((A + i) /10) (A + i) A i 10 10 {
		    		counter++;
		    	} counter++ counter System.out.println(counter) System.out.println System.out System System.out counter scanner.close() scanner.close scanner String args[] args public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); }
		  } public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); }
		  } Main
import java.util.Scanner;

public class Main {
	  
	public static void main(String args[]) {
		    Scanner scanner = new Scanner(System.in);
		    
		    int A = scanner.nextInt();
		    int B = scanner.nextInt();
		    int counter = 0;
		    
		    for(int i = 0; i <= B - A; i++) 
		    {
		    	if( ((A + i) /10000) % 10 == (A + i)% 10 && 
		    			((A + i) /1000) % 10 == ((A + i) /10) % 10 ) 
		    	{
		    		counter++;
		    	}
		    }
		    System.out.println(counter);
		    
		    scanner.close(); }
		  }