import java.util.Scanner;

public class Main {

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

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} import java.util.Scanner; Scanner java.util public class Main {

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

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		sc.close();

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} main {
		Scanner sc = new Scanner(System.in);
		int A = Integer.parseInt(sc.next());
		int B = Integer.parseInt(sc.next());
		sc.close();

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = Integer.parseInt(sc.next()); A Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int B = Integer.parseInt(sc.next()); B Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int cnt = 0; cnt 0 for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		} int i = A; int i = A; i A i <= B i B i++ i++ i {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		} {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		} String s1 = String.valueOf(i); s1 String.valueOf(i) String.valueOf String i String s2 = ""; s2 "" char[] ch = String.valueOf(i).toCharArray(); ch String.valueOf(i).toCharArray() String.valueOf(i).toCharArray String.valueOf(i) String.valueOf String i for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			} int j = ch.length-1; int j = ch.length-1; j ch.length-1 ch.length ch ch.length 1 j >= 0 j 0 j-- j-- j {
				s2 += ch[j];
			} {
				s2 += ch[j];
			} s2 += ch[j] s2 ch[j] ch j if(s1.equals(s2)) {
				cnt++;
			} s1.equals(s2) s1.equals s1 s2 {
				cnt++;
			} cnt++ cnt System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {

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

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} public class Main {

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

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
} Main
import java.util.Scanner;

public class Main {

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

		int cnt = 0;
		for(int i = A;i <= B;i++) {
			String s1 = String.valueOf(i);
			String s2 = "";
			char[] ch = String.valueOf(i).toCharArray();
			for(int j = ch.length-1;j >= 0;j--) {
				s2 += ch[j];
			}
			if(s1.equals(s2)) {
				cnt++;
			}
		}
		System.out.println(cnt);
	}
}