import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
} import java.util.*; util.* java public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
} Main static Scanner scanner = new Scanner(System.in); scanner new Scanner(System.in) public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    } main {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    } int a = scanner.nextInt(); a scanner.nextInt() scanner.nextInt scanner int b = scanner.nextInt(); b scanner.nextInt() scanner.nextInt scanner int count = 0; count 0 for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        } int i = a; int i = a; i a i <= b i b i++ i++ i {
            if (isPalindromeNumber(i)) {
                count++;
            }
        } {
            if (isPalindromeNumber(i)) {
                count++;
            }
        } if (isPalindromeNumber(i)) {
                count++;
            } isPalindromeNumber(i) isPalindromeNumber i {
                count++;
            } count++ count System.out.println(count) System.out.println System.out System System.out count String[]$ $ static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    } isPalindromeNumber {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    } String s = Integer.toString(x); s Integer.toString(x) Integer.toString Integer x for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        } int i = 0; int i = 0; i 0 i < s.length() / 2 i s.length() / 2 s.length() s.length s 2 i++ i++ i {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        } {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        } if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            } s.charAt(i) != s.charAt(s.length() - i - 1) s.charAt(i) s.charAt s i s.charAt(s.length() - i - 1) s.charAt s s.length() - i - 1 s.length() - i - 1 s.length() s.length s i 1 {
                return false;
            } return false; false return true; true int x x public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
} public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
} Main
import java.util.*;

public class Main {
    static Scanner scanner = new Scanner(System.in);

    public static void main(String[]$) {
        int a = scanner.nextInt();
        int b = scanner.nextInt();
        int count = 0;
        for (int i = a; i <= b; i++) {
            if (isPalindromeNumber(i)) {
                count++;
            }
        }
        System.out.println(count);
    }

    static boolean isPalindromeNumber(int x) {
        String s = Integer.toString(x);
        for (int i = 0; i < s.length() / 2; i++) {
            if (s.charAt(i) != s.charAt(s.length() - i - 1)) {
                return false;
            }
        }
        return true;
    }
}