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 a1,a2,a3,a4,a5;
		int count=0;
		for(int i=a;i<=b;i++){
			a1=i/10000;
			a2=i/1000-a1*10;
			a3=i/100-a1*100-a2*10;
			a4=i/10-a1*1000-a2*100-a3*10;
			a5=i-a1*10000-a2*1000-a3*100-a4*10;
			if(a1==a5 && a2==a4){
				count++;
			}
		}
		System.out.println(count);

	}
}

/tmp/hf-datasets-cache/medium/datasets/42704881117311-config-parquet-and-info-qiankunmu-Project_CodeNet-896c9d36/hub/datasets--qiankunmu--Project_CodeNet_Python800_and_Java250/snapshots/c899fde44a77ba1cc14973ed3de064e4ff3aadc7/Project_CodeNet_Java250.tar.gz