import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	}

	private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.InputStreamReader; InputStreamReader java.io import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	}

	private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	}
} Main public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	} main {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	} Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in))); in new Scanner(new BufferedReader(new InputStreamReader(System.in))) int a = in.nextInt(); a in.nextInt() in.nextInt in int b = in.nextInt(); b in.nextInt() in.nextInt in System.out.println(solve(a, b)) System.out.println System.out System System.out solve(a, b) solve a b in.close() in.close in String[] args args private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	} solve {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	} int r = 0; r 0 for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} 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++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} int j = 0; int j = 0; j 0 j <= 9 j 9 j++ j++ j for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} int k = 0; int k = 0; k 0 k <= 9 k 9 k++ k++ k {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				} int x = (i * 10001 + j * 1010 + k * 100); x (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 (x >= a && x <= b)
						r++; x >= a && x <= b x >= a x a x <= b x b r++ r return r; r int a a int b b public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	}

	private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	}
} public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	}

	private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	}
} Main
import java.io.BufferedReader;
import java.io.InputStreamReader;
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner in = new Scanner(new BufferedReader(new InputStreamReader(System.in)));
		int a = in.nextInt();
		int b = in.nextInt();
		System.out.println(solve(a, b));
		in.close();
	}

	private static int solve(int a, int b) {
		int r = 0;
		for (int i = 1; i <= 9; i++)
			for (int j = 0; j <= 9; j++)
				for (int k = 0; k <= 9; k++) {
					int x = (i * 10001 + j * 1010 + k * 100);
					if (x >= a && x <= b)
						r++;
				}
		return r;
	}
}