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 count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    }
} 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 count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    }
} Main public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    } main {
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    } 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 count = 0; count 0 for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        } int i = a; int i = a; i a i<=b i b i++ i++ i {
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        } {
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        } int aa = i%10; aa i%10 i 10 int bb = (i%100-aa)/10; bb (i%100-aa)/10 (i%100-aa) i%100 i 100 aa 10 int cc = i%1000; cc i%1000 i 1000 int dd = (i%10000-cc)/1000; dd (i%10000-cc)/1000 (i%10000-cc) i%10000 i 10000 cc 1000 int ee = (i%100000-cc-dd)/10000; ee (i%100000-cc-dd)/10000 (i%100000-cc-dd) i%100000-cc-dd i%100000 i 100000 cc dd 10000 if(aa == ee && bb == dd){
                count++;
            } aa == ee && bb == dd aa == ee aa ee bb == dd bb dd {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count 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 count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    }
} public class Main{
    public static void main(String[] args){
        Scanner sc = new Scanner(System.in);
        int a = sc.nextInt();
        int b = sc.nextInt();
        int count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    }
} 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 count = 0;
        for(int i = a;i<=b;i++){
            int aa = i%10;
            int bb = (i%100-aa)/10;
            int cc = i%1000;
            int dd = (i%10000-cc)/1000;
            int ee = (i%100000-cc-dd)/10000;
            if(aa == ee && bb == dd){
                count++;
            }
        }
        System.out.println(count);
    }
}