import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		int g=sc.nextInt();
		int cosu=0;

		for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		}
		System.out.println(cosu);
	}
} import java.util.Scanner; Scanner java.util class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		int g=sc.nextInt();
		int cosu=0;

		for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		}
		System.out.println(cosu);
	}
} Main public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		int g=sc.nextInt();
		int cosu=0;

		for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		}
		System.out.println(cosu);
	} main {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		int g=sc.nextInt();
		int cosu=0;

		for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		}
		System.out.println(cosu);
	} Scanner sc=new Scanner(System.in); sc new Scanner(System.in) int s=sc.nextInt(); s sc.nextInt() sc.nextInt sc int g=sc.nextInt(); g sc.nextInt() sc.nextInt sc int cosu=0; cosu 0 for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		} int i=s; int i=s; i s i<=g i g i++ i++ i {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		} {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		} int a=i/10000; a i/10000 i 10000 int b=(i%10000)/1000; b (i%10000)/1000 (i%10000) i 10000 1000 int c=(i%1000)/100; c (i%1000)/100 (i%1000) i 1000 100 int d=(i%100)/10; d (i%100)/10 (i%100) i 100 10 int e=i%10; e i%10 i 10 if(a==e && b==d) {
				cosu++;
			} a==e && b==d a==e a e b==d b d {
				cosu++;
			} cosu++ cosu System.out.println(cosu) System.out.println System.out System System.out cosu String[] args args
import java.util.Scanner;

class Main{
	public static void main(String[] args) {
		Scanner sc=new Scanner(System.in);
		int s=sc.nextInt();
		int g=sc.nextInt();
		int cosu=0;

		for(int i=s; i<=g; i++) {
			int a=i/10000;
			int b=(i%10000)/1000;
			int c=(i%1000)/100;
			int d=(i%100)/10;
			int e=i%10;

			if(a==e && b==d) {
				cosu++;
			}
		}
		System.out.println(cosu);
	}
}