import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						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 N =0; N 0 int ans =0; ans 0 for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		} int i=1; int i=1; i 1 i<=9 i 9 i++ i++ i {
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		} {
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		} for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			} int j=0; int j=0; j 0 j<=9 j 9 j++ j++ j {
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			} {
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			} for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				} int k=0; int k=0; k 0 k<=9 k 9 k++ k++ k {
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				} {
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				} N = i*10001+j*1010+k*100 N i*10001+j*1010+k*100 i*10001+j*1010+k*100 i*10001 i 10001 j*1010 j 1010 k*100 k 100 if(A<=N && N<=B){
						ans++;
					} A<=N && N<=B A<=N A N N<=B N B {
						ans++;
					} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		
		int A =sc.nextInt();
		int B =sc.nextInt();
		int N =0;
		int ans =0;
			
		for(int i=1; i<=9; i++){
			for(int j=0; j<=9; j++){
				for(int k=0; k<=9; k++){
					N = i*10001+j*1010+k*100;
					if(A<=N && N<=B){
						ans++;
					}
				}
			}
		}
			System.out.println(ans);
	}
}