import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} import java.io.InputStream; InputStream java.io import java.io.PrintStream; PrintStream java.io import java.util.Scanner; Scanner java.util public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} Main InputStream in = System.in; in System.in System System.in PrintStream out = System.out; out System.out System System.out private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	} check {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	} char[] c = String.valueOf(n).toCharArray(); c String.valueOf(n).toCharArray() String.valueOf(n).toCharArray String.valueOf(n) String.valueOf String n boolean result = true; result true for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		} int i = 0; int i = 0; i 0 i < c.length / 2 i c.length / 2 c.length c c.length 2 i++ i++ i {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		} {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		} if (c[i] != c[c.length - i - 1]) {
				result = false;
			} c[i] != c[c.length - i - 1] c[i] c i c[c.length - i - 1] c c.length - i - 1 c.length - i - 1 c.length c c.length i 1 {
				result = false;
			} result = false result false return result; result int n n public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	} _main {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	} Scanner sc = new Scanner(in); sc new Scanner(in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc sc.close() sc.close sc int ans = 0; ans 0 for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		} int x = A; int x = A; x A x <= B x B x++ x++ x {
			if (check(x)) {
				ans++;
			}
		} {
			if (check(x)) {
				ans++;
			}
		} if (check(x)) {
				ans++;
			} check(x) check x {
				ans++;
			} ans++ ans out.println(ans) out.println out ans String[] args args public static void main(String[] args) {
		new Main()._main(args);
	} main {
		new Main()._main(args);
	} new Main()._main(args) new Main()._main new Main() args String[] args args public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
} Main
import java.io.InputStream;
import java.io.PrintStream;
import java.util.Scanner;

public class Main {
	InputStream in = System.in;
	PrintStream out = System.out;

	private boolean check(int n) {
		char[] c = String.valueOf(n).toCharArray();

		boolean result = true;
		for (int i = 0; i < c.length / 2; i++) {
			if (c[i] != c[c.length - i - 1]) {
				result = false;
			}
		}

		return result;

	}

	public void _main(String[] args) {
		Scanner sc = new Scanner(in);

		int A = sc.nextInt();
		int B = sc.nextInt();

		sc.close();

		int ans = 0;

		for (int x = A; x <= B; x++) {
			if (check(x)) {
				ans++;
			}
		}

		out.println(ans);

	}

	public static void main(String[] args) {
		new Main()._main(args);
	}
}
