import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	}
} 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(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	} main {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) 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 b=sc.nextInt(); b sc.nextInt() sc.nextInt sc String str = null; str null int count = 0; count 0 for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		} ; a <= b a b a++ a++ a {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		} {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		} str = String.valueOf(a) str String.valueOf(a) String.valueOf String a if(str.equals(new StringBuilder(str).reverse().toString())) count++; str.equals(new StringBuilder(str).reverse().toString()) str.equals str new StringBuilder(str).reverse().toString() new StringBuilder(str).reverse().toString new StringBuilder(str).reverse() new StringBuilder(str).reverse new StringBuilder(str) count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		Scanner sc = new Scanner(System.in);
		int a=sc.nextInt(),b=sc.nextInt();
		String str = null;
		int count = 0;
		for(;a <= b; a++) {
			str = String.valueOf(a);
			if(str.equals(new StringBuilder(str).reverse().toString())) count++;
		}
		System.out.println(count);
	}
}
