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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				ans++;
			}
		} int i = 0; int i = 0; i 0 i <= (b - a) i (b - a) b a i++ i++ i {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				ans++;
			}
		} {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				ans++;
			}
		} String sb = String.valueOf((b - i)); sb String.valueOf((b - i)) String.valueOf String (b - i) b i String rb = (new StringBuilder(sb)).reverse().toString(); rb (new StringBuilder(sb)).reverse().toString() (new StringBuilder(sb)).reverse().toString (new StringBuilder(sb)).reverse() (new StringBuilder(sb)).reverse (new StringBuilder(sb)) if (sb.equals(rb)) {
				ans++;
			} sb.equals(rb) sb.equals sb rb {
				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) {
		Scanner sc = new Scanner((System.in));
		int a = sc.nextInt();
		int b = sc.nextInt();
		int ans = 0;

		for (int i = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				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 = 0; i <= (b - a); i++) {
			String sb = String.valueOf((b - i));
			String rb = (new StringBuilder(sb)).reverse().toString();
			if (sb.equals(rb)) {
				ans++;
			}
		}
		
		System.out.println(ans);

		sc.close();
	}
}
