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 n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	}
} 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 n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	} main {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	} 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 n1 n1 n2 n2 n4 n4 n5 n5 t t cnt = 0; cnt 0 for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		} {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		} t = i t i n1 = t % 10 n1 t % 10 t 10 t = t / 10 t t / 10 t 10 n2 = t % 10 n2 t % 10 t 10 t = t / 100 t t / 100 t 100 n4 = t % 10 n4 t % 10 t 10 t = t / 10 t t / 10 t 10 n5 = t % 10 n5 t % 10 t 10 if (n1 == n5 && n2 == n4) {
				cnt++;
			} n1 == n5 && n2 == n4 n1 == n5 n1 n5 n2 == n4 n2 n4 {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt 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 n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	}
} 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 n1, n2, n4, n5, t, cnt = 0;
		for (int i = a; i <= b; i++) {
			t = i;
			n1 = t % 10;
			t = t / 10;
			n2 = t % 10;
			t = t / 100;
			n4 = t % 10;
			t = t / 10;
			n5 = t % 10;
			if (n1 == n5 && n2 == n4) {
				cnt++;
			}
		}
		System.out.println(cnt);

	}
}
