import java.util.Scanner;
 
public class Main {
  public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  }
} import java.util.Scanner; Scanner java.util public class Main {
  public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  }
} Main public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  } main {
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  } int a a b; b int tmp=0 tmp 0 cnt=0; cnt 0 Scanner sc = new Scanner (System.in); sc new Scanner (System.in) a=sc.nextInt() a sc.nextInt() sc.nextInt sc b=sc.nextInt() b sc.nextInt() sc.nextInt sc for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   } int i=a; int i=a; i a i<=b i b i++ i++ i {
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   } {
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   } tmp=i%10 tmp i%10 i 10 if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    } i/10000 == tmp i/10000 i 10000 tmp {
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    } tmp=(i/10)%10 tmp (i/10)%10 (i/10) i 10 10 if((i/1000)%10 == tmp){
       cnt=cnt+1;
      } (i/1000)%10 == tmp (i/1000)%10 (i/1000) i 1000 10 tmp {
       cnt=cnt+1;
      } cnt=cnt+1 cnt cnt+1 cnt 1 System.out.println(cnt) System.out.println System.out System System.out cnt String[] args args public class Main {
  public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  }
} public class Main {
  public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  }
} Main
import java.util.Scanner;
 
public class Main {
  public static void main (String[] args){
    
   int a,b;
   int tmp=0,cnt=0; 
 
   Scanner sc = new Scanner (System.in);
   a=sc.nextInt();
   b=sc.nextInt();

   for(int i=a;i<=b;i++){
     tmp=i%10;
     if(i/10000 == tmp){
      tmp=(i/10)%10;
      if((i/1000)%10 == tmp){
       cnt=cnt+1;
      }
    }
   }

   System.out.println(cnt);
  }
}