import java.util.*;
// warm-up
public class Main {

	static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	}

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

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

	static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	}

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	} isPalindrome {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	} int i=0 i 0 j=s.length()-1; j s.length()-1 s.length() s.length s 1 boolean ok = true; ok true while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		} i<j i j {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		} if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			} s.charAt(i++)!=s.charAt(j--) s.charAt(i++) s.charAt s i++ i s.charAt(j--) s.charAt s j-- j {
				ok=false; break;
			} ok=false ok false break; return ok; ok String s s static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	} solve {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt() A sc.nextInt() sc.nextInt sc B = sc.nextInt() B sc.nextInt() sc.nextInt sc t = 0; t 0 while (A<=B) if (isPalindrome(""+A++)) t++; A<=B A B if (isPalindrome(""+A++)) t++; isPalindrome(""+A++) isPalindrome ""+A++ "" A++ A t++ t System.out.println(t) System.out.println System.out System System.out t sc.close() sc.close sc public static void main(String args[]) {
		solve();
	} main {
		solve();
	} solve() solve String args[] args public class Main {

	static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	}

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} public class Main {

	static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	}

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

} Main
import java.util.*;
// warm-up
public class Main {

	static boolean isPalindrome (String s) {
		int i=0, j=s.length()-1;
		boolean ok = true;
		while (i<j) {
			if (s.charAt(i++)!=s.charAt(j--)) {
				ok=false; break;
			}
		}
		return ok;
	}

	static void solve() {
		Scanner sc = new Scanner(System.in);
		int A = sc.nextInt(), B = sc.nextInt(), t = 0;
		while (A<=B) if (isPalindrome(""+A++)) t++;
		System.out.println(t);
		sc.close();		
	}

	public static void main(String args[]) {
		solve();
	}

}