import 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 x1 = 0;
      int x2 = 0;
      int x3 = 0;
      int x4 = 0;
      int x5 = 0;
      int count = 0;
      for(int i = a;i <= b;i++){
      	x5 = i%10;
        x1 = i/10000;
        x2 = (i-x1*10000)/1000;
        x3 = (i-x1*10000-x2*1000)/100;
        x4 = (i-x1*10000-x2*1000-x3*100)/10;
        if(x1==x5&&x2==x4)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