import java.util.Scanner;
public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
}
} import java.util.Scanner; Scanner java.util public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
}
} Main public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
} main {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
} Scanner scan=new Scanner(System.in); scan new Scanner(System.in) int a=scan.nextInt(); a scan.nextInt() scan.nextInt scan int b=scan.nextInt(); b scan.nextInt() scan.nextInt scan int ans=0; ans 0 for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	} int i=a; int i=a; i a i<=b i b i++ i++ i {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	} {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	} int x=i; x i int c=x%10; c x%10 x 10 x/=10 x 10 int d=x%10; d x%10 x 10 x/=10 x 10 x/=10 x 10 int f=x%10; f x%10 x 10 x/=10 x 10 int g=x%10; g x%10 x 10 if(c==g&&d==f) {
			ans++;
		} c==g&&d==f c==g c g d==f d f {
			ans++;
		} ans++ ans System.out.println(ans) System.out.println System.out System System.out ans scan.close() scan.close scan String[]srgs srgs public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
}
} public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
}
} Main
import java.util.Scanner;
public class Main {
public static void main(String[]srgs) {
	Scanner scan=new Scanner(System.in);
	int a=scan.nextInt();
	int b=scan.nextInt();
	int ans=0;
	for(int i=a;i<=b;i++) {
		int x=i;
		int c=x%10;
		x/=10;
		int d=x%10;
		x/=10;
		x/=10;
		int f=x%10;
		x/=10;
		int g=x%10;
		if(c==g&&d==f) {
			ans++;
		}
	}
	System.out.println(ans);
	scan.close();
}
}