import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} import java.io.*; io.* java import java.util.*; util.* java public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} Main private static Scanner sc; sc private static Printer pr; pr private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	} solve {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	} int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc int ans = 0; ans 0 pr.println(ans) pr.println pr ans // ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	} main {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	} sc = new Scanner(System.in) sc new Scanner(System.in) pr = new Printer(System.out) pr new Printer(System.out) solve() solve pr.close() pr.close pr sc.close() sc.close sc String[] args args private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	} Printer Printer(PrintStream out) {
			super(out);
		} Printer {
			super(out);
		} super(out) super out PrintStream out out PrintWriter public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
} Main
import java.io.*;
import java.util.*;


public class Main {

	private static Scanner sc;
	private static Printer pr;

	private static void solve() {
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		out:
		for (int i = a; i <= b; i++) {
			char[] s = Integer.toString(i).toCharArray();

			for (int j = 0; j < s.length / 2; j++) {
				if (s[j] != s[s.length - 1 - j]) {
					continue out;
				}
			}

			ans++;
		}

		pr.println(ans);
	}

	// ---------------------------------------------------
	public static void main(String[] args) {
		sc = new Scanner(System.in);
		pr = new Printer(System.out);

		solve();

		pr.close();
		sc.close();
	}

	private static class Printer extends PrintWriter {
		Printer(PrintStream out) {
			super(out);
		}
	}
}
