import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	}
} import java.io.BufferedReader; BufferedReader java.io import java.io.IOException; IOException java.io import java.io.InputStreamReader; InputStreamReader java.io public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	}
} Main public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	} main {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	} BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); br new BufferedReader(new InputStreamReader(System.in)) String[] text = br.readLine().split(" "); text br.readLine().split(" ") br.readLine().split br.readLine() br.readLine br " " int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) }; range_numbers { Integer.valueOf(text[0]), Integer.valueOf(text[1]) } Integer.valueOf(text[0]) Integer.valueOf Integer text[0] text 0 Integer.valueOf(text[1]) Integer.valueOf Integer text[1] text 1 int result = 0; result 0 for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		} int i = range_numbers[0]; int i = range_numbers[0]; i range_numbers[0] range_numbers 0 i <= range_numbers[1] i range_numbers[1] range_numbers 1 i++ i++ i {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		} {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		} String number = String.valueOf(i); number String.valueOf(i) String.valueOf String i String a = number.substring(3, 4); a number.substring(3, 4) number.substring number 3 4 String b = number.substring(4, 5); b number.substring(4, 5) number.substring number 4 5 if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++; number.substring(0, 2).equalsIgnoreCase(b + a) number.substring(0, 2).equalsIgnoreCase number.substring(0, 2) number.substring number 0 2 b + a b a result++ result System.out.println(result) System.out.println System.out System System.out result String[] args args public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	}
} public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	}
} Main
import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader;

public class Main {

	public static void main(String[] args) throws IOException {
		BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
		String[] text = br.readLine().split(" ");
		int[] range_numbers = { Integer.valueOf(text[0]), Integer.valueOf(text[1]) };
		int result = 0;
		for (int i = range_numbers[0]; i <= range_numbers[1]; i++) {
			String number = String.valueOf(i);
			String a = number.substring(3, 4);
			String b = number.substring(4, 5);
			if (number.substring(0, 2).equalsIgnoreCase(b + a)) result++;
		}
		System.out.println(result);
	}
}