import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	}
} import java.util.Scanner; Scanner java.util public class Main {
	public static void main(String[] args) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	}
} Main public static void main(String[] args) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	} main {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	} String[] info = new Scanner(System.in).nextLine().split(" "); info new Scanner(System.in).nextLine().split(" ") new Scanner(System.in).nextLine().split new Scanner(System.in).nextLine() new Scanner(System.in).nextLine new Scanner(System.in) " " Integer min=Integer.valueOf(info[0]); min Integer.valueOf(info[0]) Integer.valueOf Integer info[0] info 0 Integer max=Integer.valueOf(info[1]); max Integer.valueOf(info[1]) Integer.valueOf Integer info[1] info 1 int count=0; count 0 for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		} Integer i=min; Integer i=min; i min i<=max i max i++ i++ i {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		} {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		} char[] numlist=i.toString().toCharArray(); numlist i.toString().toCharArray() i.toString().toCharArray i.toString() i.toString i if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++; numlist[0]==numlist[4]&&numlist[1]==numlist[3] numlist[0]==numlist[4] numlist[0] numlist 0 numlist[4] numlist 4 numlist[1]==numlist[3] numlist[1] numlist 1 numlist[3] numlist 3 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) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	}
} public class Main {
	public static void main(String[] args) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	}
} Main
import java.util.Scanner;

public class Main {
	public static void main(String[] args) {
		String[] info = new Scanner(System.in).nextLine().split(" ");
		Integer min=Integer.valueOf(info[0]);
		Integer max=Integer.valueOf(info[1]);
		int count=0;
		for(Integer i=min;i<=max;i++) {
			char[] numlist=i.toString().toCharArray();
			if(numlist[0]==numlist[4]&&numlist[1]==numlist[3])
				count++;
		}
		System.out.println(count);
	}
}