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 ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    }
}
 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 ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    } 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 ans = 0; ans 0 for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        } int i=A; int i=A; i A i<=B i B i++ i++ i {
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        } {
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        } if(i%10==0) continue; i%10==0 i%10 i 10 0 continue; StringBuilder sb = new StringBuilder(); sb new StringBuilder() int j=i; j i while(j>0){
                sb.append(j%10);
                j=j/10;
            } j>0 j 0 {
                sb.append(j%10);
                j=j/10;
            } sb.append(j%10) sb.append sb j%10 j 10 j=j/10 j j/10 j 10 String s1 = sb.toString(); s1 sb.toString() sb.toString sb String s2 = sb.reverse().toString(); s2 sb.reverse().toString() sb.reverse().toString sb.reverse() sb.reverse sb if(s1.equals(s2)) ans++; s1.equals(s2) s1.equals s1 s2 ans++ ans System.out.println(ans) System.out.println System.out System System.out ans 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 ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int A = sc.nextInt();
        int B = sc.nextInt();
        int ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    }
} 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 ans = 0;
        for(int i=A;i<=B;i++){
            if(i%10==0) continue;
            StringBuilder sb = new StringBuilder();
            int j=i;
            while(j>0){
                sb.append(j%10);
                j=j/10;
            }
            String s1 = sb.toString();
            String s2 = sb.reverse().toString();
            if(s1.equals(s2)) ans++;
        }

        System.out.println(ans);
    }
}

