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 ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	}

} 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 ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	} 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 ans = 0; ans 0 for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		} {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		} boolean can = true; can true String x = String.valueOf(i); x String.valueOf(i) String.valueOf String i for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			} int j = 0; int j = 0; j 0 j < x.length() / 2 j x.length() / 2 x.length() x.length x 2 j++ j++ j {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			} {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			} if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false; x.charAt(j) != x.charAt(x.length() - j - 1) x.charAt(j) x.charAt x j x.charAt(x.length() - j - 1) x.charAt x x.length() - j - 1 x.length() - j - 1 x.length() x.length x j 1 can = false can false if (can) ans++; can ans++ ans System.out.println(ans) System.out.println System.out System System.out ans sc.close() sc.close sc 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 ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();

		int ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	}

} 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 ans = 0;
		for (int i = a; i <= b; i++) {
			boolean can = true;
			String x = String.valueOf(i);
			for (int j = 0; j < x.length() / 2; j++) {
				if (x.charAt(j) != x.charAt(x.length() - j - 1)) can = false;
			}
			if (can) ans++;
		}

		System.out.println(ans);


		sc.close();
	}

}
