import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				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++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				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++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		} {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		} StringBuilder num = new StringBuilder(); num new StringBuilder() num.append(i) num.append num i StringBuilder revNum = new StringBuilder(); revNum new StringBuilder() revNum.append(i).reverse() revNum.append(i).reverse revNum.append(i) revNum.append revNum i if (num.toString().equals(revNum.toString())) {
				ans++;
			} num.toString().equals(revNum.toString()) num.toString().equals num.toString() num.toString num revNum.toString() revNum.toString revNum {
				ans++;
			} 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) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) throws Exception {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		int ans = 0;
		for (int i = A; i <= B; i++) {
			StringBuilder num = new StringBuilder();
			num.append(i);
			StringBuilder revNum = new StringBuilder();
			revNum.append(i).reverse();
			if (num.toString().equals(revNum.toString())) {
				ans++;
			}
		}
		System.out.println(ans);
		sc.close();
	}
}