import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
	public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	}
} import java.util.*; util.* java import java.lang.*; lang.* java import java.io.*; io.* java public class Main {
	public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	}
} Main public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	} isPalindrome {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	} String s = ""+n; s ""+n "" n String a = ""; a "" for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		} int i = s.length()-1; int i = s.length()-1; i s.length()-1 s.length() s.length s 1 i>=0 i 0 i-- i-- i {
			a += s.charAt(i);
		} {
			a += s.charAt(i);
		} a += s.charAt(i) a s.charAt(i) s.charAt s i return s.equals(a); s.equals(a) s.equals s a int n n public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	} 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 count = 0; count 0 for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			if (isPalindrome(i)) count++;
		} {
			if (isPalindrome(i)) count++;
		} if (isPalindrome(i)) count++; isPalindrome(i) isPalindrome i count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	}
} public class Main {
	public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	}
} Main
import java.util.*;
import java.lang.*;
import java.io.*;

public class Main {
	public static boolean isPalindrome(int n) {
		String s = ""+n;

		String a = "";
		for (int i = s.length()-1; i>=0; i--) {
			a += s.charAt(i);
		}

		return s.equals(a);
	}

	public static void main(String[] args) throws IOException {
		Scanner sc = new Scanner(System.in);
		//Scanner sc = new Scanner(new File("B.txt"));

		int a = sc.nextInt();
		int b = sc.nextInt();

		int count = 0;
		for (int i = a; i <= b; i++) {
			if (isPalindrome(i)) count++;
		}

		System.out.println(count);
	}
}