import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

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

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

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

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

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

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int cnt = 0; cnt 0 boolean bo = true; bo true for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		} {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		} String s = String.valueOf(i); s String.valueOf(i) String.valueOf String i for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			} int j = 0; int j = 0; j 0 j < s.length() / 2 j s.length() / 2 s.length() s.length s 2 j++ j++ j {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			} {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			} if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				} s.charAt(j) == s.charAt(s.length() - 1 - j) s.charAt(j) s.charAt s j s.charAt(s.length() - 1 - j) s.charAt s s.length() - 1 - j s.length() - 1 - j s.length() s.length s 1 j {
					continue;
				} continue; {
					bo = false;
					break;
				} bo = false bo false break; if (bo) {
				cnt++;
			} bo {
				cnt++;
			} cnt++ cnt bo = true bo true System.out.println(cnt) System.out.println System.out System System.out cnt String args[] args public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

	}
} public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

	}
} Main
import java.util.Scanner;

public class Main {

	@SuppressWarnings("resource")
	public static void main(String args[]) {
		Scanner scanner = new Scanner(System.in);
		int a = scanner.nextInt();
		int b = scanner.nextInt();

		int cnt = 0;
		boolean bo = true;
		for (int i = a; i <= b; i++) {
			String s = String.valueOf(i);
			for (int j = 0; j < s.length() / 2; j++) {
				if (s.charAt(j) == s.charAt(s.length() - 1 - j)) {
					continue;
				} else {
					bo = false;
					break;
				}
			}
			if (bo) {
				cnt++;
			}
			bo = true;
		}
		
		System.out.println(cnt);

	}
}
