import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	}

} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	}

} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	} main {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) String[] str1 = sc.nextLine().split(" "); str1 sc.nextLine().split(" ") sc.nextLine().split sc.nextLine() sc.nextLine sc " " int a = Integer.parseInt(str1[0]); a Integer.parseInt(str1[0]) Integer.parseInt Integer str1[0] str1 0 int b = Integer.parseInt(str1[1]); b Integer.parseInt(str1[1]) Integer.parseInt Integer str1[1] str1 1 int count = 0; count 0 for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		} ; a <= b a b a++ a++ a {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		} {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		} int tmp = a; tmp a int reverse = 0; reverse 0 while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			} tmp > 0 tmp 0 {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			} int residue = tmp % 10; residue tmp % 10 tmp 10 reverse = reverse * 10 + residue reverse reverse * 10 + residue reverse * 10 reverse 10 residue tmp /= 10 tmp 10 if (a == reverse)
				count++; a == reverse a reverse count++ count System.out.println(count) System.out.println System.out System System.out count sc.close() sc.close sc String[] args args public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	}

} public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		String[] str1 = sc.nextLine().split(" ");
		int a = Integer.parseInt(str1[0]);
		int b = Integer.parseInt(str1[1]);
		int count = 0;

		for (; a <= b; a++) {
			int tmp = a;
			int reverse = 0;
			while (tmp > 0) {
				int residue = tmp % 10;
				reverse = reverse * 10 + residue;
				tmp /= 10;
			}
			if (a == reverse)
				count++;
		}
		System.out.println(count);

		sc.close();

	}

}
