import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	}

} 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();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	}

} Main public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	} main {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	} 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 answer = 0; answer 0 for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		} int i = a; int i = a; i a i <= b i b i++ i++ i {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		} {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		} if(i % 10 ==0) {
				continue;
			} i % 10 ==0 i % 10 i 10 0 {
				continue;
			} continue; String[] hoge = String.valueOf(i).split(""); hoge String.valueOf(i).split("") String.valueOf(i).split String.valueOf(i) String.valueOf String i "" if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			} hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3]) hoge[0].equals(hoge[4]) hoge[0].equals hoge[0] hoge 0 hoge[4] hoge 4 hoge[1].equals(hoge[3]) hoge[1].equals hoge[1] hoge 1 hoge[3] hoge 3 {
				answer++;
			} answer++ answer System.out.println(answer) System.out.println System.out System System.out answer String[] args args public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	}

} public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	}

} Main
import java.util.Scanner;

public class Main {

	public static void main(String[] args) {


		Scanner sc = new Scanner(System.in);
		int a = sc.nextInt();
		int b = sc.nextInt();
		int answer = 0;
		for(int i = a;i <= b; i++) {
			if(i % 10 ==0) {
				continue;
			}
			String[] hoge = String.valueOf(i).split("");
			if(hoge[0].equals(hoge[4])
					&& hoge[1].equals(hoge[3])){
				answer++;
			}
		}
		System.out.println(answer);
	}

}