import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }

    private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    }
} import java.util.Scanner; Scanner java.util public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }

    private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    }
} Main public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    } main {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    } try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        } {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        } Scanner in = new Scanner(System.in) Scanner in = new Scanner(System.in) new Scanner(System.in) int A = in.nextInt(); A in.nextInt() in.nextInt in int B = in.nextInt(); B in.nextInt() in.nextInt in int count = 0; count 0 for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            } int i = A; int i = A; i A i <= B i B i++ i++ i {
                if (isPalindrome("" + i)) {
                    count++;
                }
            } {
                if (isPalindrome("" + i)) {
                    count++;
                }
            } if (isPalindrome("" + i)) {
                    count++;
                } isPalindrome("" + i) isPalindrome "" + i "" i {
                    count++;
                } count++ count System.out.println(count) System.out.println System.out System System.out count String[] args args private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    } isPalindrome {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    } for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        } int l = 0, r = s.length() - 1; int l = 0 l 0 r = s.length() - 1; r s.length() - 1 s.length() s.length s 1 l < r l r l++, r-- l++ l r-- r {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        } {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        } if (s.charAt(l) != s.charAt(r)) {
                return false;
            } s.charAt(l) != s.charAt(r) s.charAt(l) s.charAt s l s.charAt(r) s.charAt s r {
                return false;
            } return false; false return true; true String s s public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }

    private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    }
} public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }

    private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    }
} Main
import java.util.Scanner;

public class Main {
    public static void main(String[] args) {
        try (Scanner in = new Scanner(System.in)) {
            int A = in.nextInt();
            int B = in.nextInt();

            int count = 0;
            for (int i = A; i <= B; i++) {
                if (isPalindrome("" + i)) {
                    count++;
                }
            }
            System.out.println(count);
        }
    }

    private static boolean isPalindrome(String s) {
        for (int l = 0, r = s.length() - 1; l < r; l++, r--) {
            if (s.charAt(l) != s.charAt(r)) {
                return false;
            }
        }
        return true;
    }
}
