import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	}
} import java.util.Scanner; Scanner java.util public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	}
} Main public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	} main {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	} Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) Integer output = 0; output 0 Integer aInteger = new Integer(scanner.next()); aInteger new Integer(scanner.next()) Integer bInteger = new Integer(scanner.next()); bInteger new Integer(scanner.next()) StringBuffer buffer ; buffer for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		} int i = aInteger; int i = aInteger; i aInteger i <= bInteger i bInteger i++ i++ i {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		} {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		} buffer = new StringBuffer(String.valueOf(i)) buffer new StringBuffer(String.valueOf(i)) if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			} String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0 String.valueOf(i).compareTo(String.valueOf(buffer.reverse())) String.valueOf(i).compareTo String.valueOf(i) String.valueOf String i String.valueOf(buffer.reverse()) String.valueOf String buffer.reverse() buffer.reverse buffer 0 {
				output++;
			} output++ output System.out.println(output) System.out.println System.out System System.out output scanner.close() scanner.close scanner String[] args args public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	}
} public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	}
} Main
import java.util.Scanner;
public class Main {

	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		Integer output = 0;
		Integer aInteger = new Integer(scanner.next());
		Integer bInteger = new Integer(scanner.next());

		StringBuffer buffer ;
		for(int i = aInteger; i <= bInteger;i++ ) {
			buffer = new StringBuffer(String.valueOf(i));
			if(String.valueOf(i).compareTo(String.valueOf(buffer.reverse()))==0) {
				output++;
			}
		}
		System.out.println(output);
		scanner.close();
	}
}
