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();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	}
} 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();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	}
} Main public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	} 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 sc.close() sc.close sc int ans = 0; ans 0 for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		} Integer i = A; Integer i = A; i A i <= B i B i++ i++ i {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		} {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		} String s = i.toString(); s i.toString() i.toString i StringBuffer sb = new StringBuffer(s); sb new StringBuffer(s) String sR = sb.reverse().toString(); sR sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb if (s.equals(sR))
				ans++; s.equals(sR) s.equals s sR ans++ ans System.out.println(ans) System.out.println System.out System System.out ans 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();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	}
} public class Main {

	public static void main(String args[]) {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt();
		int B = sc.nextInt();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	}
} 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();
		sc.close();

		int ans = 0;

		for (Integer i = A; i <= B; i++) {
			String s = i.toString();
			StringBuffer sb = new StringBuffer(s);
			String sR = sb.reverse().toString();
			if (s.equals(sR))
				ans++;
		}

		System.out.println(ans);
	}
}