import java.util.*;

public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)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 ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        }
        System.out.println(ans);
    }
} Main public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        }
        System.out.println(ans);
    } main {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        }
        System.out.println(ans);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int ans = 0; ans 0 int a = sc.nextInt(); a sc.nextInt() sc.nextInt sc int b = sc.nextInt(); b sc.nextInt() sc.nextInt sc for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        } int i=a; int i=a; i a i<=b i b i++ i++ i {
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        } {
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        } boolean bool = true; bool true String s = Integer.toString(i); s Integer.toString(i) Integer.toString Integer i for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            } int j=0; int j=0; j 0 j<s.length() j s.length() s.length s j++ j++ j {
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            } {
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            } if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false; s.charAt(j)!=s.charAt(s.length()-j-1) s.charAt(j) s.charAt s j s.charAt(s.length()-j-1) s.charAt s s.length()-j-1 s.length()-j-1 s.length() s.length s j 1 bool=false bool false if (bool)ans++; bool 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 ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        }
        System.out.println(ans);
    }
} public class Main {
    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)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 ans = 0;
        int a = sc.nextInt();
        int b = sc.nextInt();
        for (int i=a;i<=b;i++){
            boolean bool = true;
            String s = Integer.toString(i);
            for (int j=0;j<s.length();j++){
                if (s.charAt(j)!=s.charAt(s.length()-j-1))bool=false;
            }
            if (bool)ans++;
        }
        System.out.println(ans);
    }
}
