import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int l = sc.nextInt(); l sc.nextInt() sc.nextInt sc int r = sc.nextInt(); r sc.nextInt() sc.nextInt sc int count = 0; count 0 for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		} int a = 1; int a = 1; a 1 a < 10 a 10 a++ a++ a {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		} {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		} for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			} int b  = 0; int b  = 0; b 0 b < 10 b 10 b++ b++ b {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			} {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			} for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				} int c = 0; int c = 0; c 0 c < 10 c 10 c++ c++ c {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				} {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				} int temp = (10001*a)+(1010*b)+(100*c); temp (10001*a)+(1010*b)+(100*c) (10001*a)+(1010*b)+(100*c) (10001*a) 10001 a (1010*b) 1010 b (100*c) 100 c if(temp >= l &&temp <= r) {
						count++;
					} temp >= l &&temp <= r temp >= l temp l temp <= r temp r {
						count++;
					} count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int l = sc.nextInt();
		int r = sc.nextInt();
		int count = 0;
		for(int a = 1; a < 10; a++) {
			for(int b  = 0; b < 10; b++) {
				for(int c = 0; c < 10; c++) {
					int temp = (10001*a)+(1010*b)+(100*c);
					if(temp >= l &&temp <= r) {
						count++;
					}
				}
			}
		}
		System.out.println(count);
	}
}
