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 cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	}
} import java.util.*; util.* java public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	}
} Main public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	} main {
		Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	} Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int A = sc.nextInt(); A sc.nextInt() sc.nextInt sc int B = sc.nextInt(); B sc.nextInt() sc.nextInt sc int cnt = 0; cnt 0 int kari = 0; kari 0 for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        } int i=A; int i=A; i A i<=B i B i++ i++ i {
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        } {
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        } kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100)) kari i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100)) 101*((i%100)-(i%10)) i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100)) i 10001*(i%10) 10001 (i%10) i 10 101*((i%100)-(i%10)) 101 ((i%100)-(i%10)) (i%100) i 100 (i%10) i 10 ((i%1000)-(i%100)) (i%1000) i 1000 (i%100) i 100 if(kari == 0){
            cnt++;
          } kari == 0 kari 0 {
            cnt++;
          } cnt++ cnt 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){
		Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	}
} public class Main {
	public static void main(String[] args){
		Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	}
} Main
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 cnt = 0;
        int kari = 0;
        for(int i=A;i<=B;i++){
          kari = i - 10001*(i%10) - 101*((i%100)-(i%10)) - ((i%1000)-(i%100));
//          System.out.println(cnt);
          if(kari == 0){
            cnt++;
          }
        }

        System.out.println(cnt);  
	}
}