import java.util.*;
public class Main {
	public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	}
    public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    }

} import java.util.*; util.* java public class Main {
	public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	}
    public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    }

} Main public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	} ishuan {
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	} int a1=n%10; a1 n%10 n 10 int a2=n/10000; a2 n/10000 n 10000 int b1=(n%100-n%10)/10; b1 (n%100-n%10)/10 (n%100-n%10) n%100 n 100 n%10 n 10 10 int b2=(n/1000-n/10000*10); b2 (n/1000-n/10000*10) n/1000 n 1000 n/10000*10 n/10000 n 10000 10 if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		} a1==a2&&b1==b2 a1==a2 a1 a2 b1==b2 b1 b2 {
			return 1;
		} return 1; 1 {
			return 0;
		} return 0; 0 int n n public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    } main {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    } Scanner kb=new Scanner(System.in); kb new Scanner(System.in) while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        } kb.hasNext() kb.hasNext kb {
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        } int a=kb.nextInt(); a kb.nextInt() kb.nextInt kb int b=kb.nextInt(); b kb.nextInt() kb.nextInt kb int sum=0; sum 0 for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			} int i = a; int i = a; i a i <= b i b i++ i++ i {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			} {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			} int ans=ishuan(i); ans ishuan(i) ishuan i if(ans==1){
					sum++;
				} ans==1 ans 1 {
					sum++;
				} sum++ sum System.out.println(sum) System.out.println System.out System System.out sum String[] args args public class Main {
	public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	}
    public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    }

} public class Main {
	public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	}
    public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    }

} Main
import java.util.*;
public class Main {
	public static int ishuan(int n){
		int a1=n%10;
		int a2=n/10000;
		int b1=(n%100-n%10)/10;
		int b2=(n/1000-n/10000*10);
		if(a1==a2&&b1==b2){
			return 1;
		}else{
			return 0;
		}
		
		
	}
    public static void main(String[] args) {
        Scanner kb=new Scanner(System.in);
        while(kb.hasNext()){
        	int a=kb.nextInt();
        	int b=kb.nextInt();  
        	int sum=0;
        	for (int i = a; i <= b; i++) {
				int ans=ishuan(i);
				if(ans==1){
					sum++;
				}
			}
        	System.out.println(sum);
        }
              
    }

}