import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
} import java.util.*; util.* java public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
} Main public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    } main {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    } Scanner sc = new Scanner(System.in); sc new Scanner(System.in) int a = Integer.parseInt(sc.next()); a Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc int b = Integer.parseInt(sc.next()); b Integer.parseInt(sc.next()) Integer.parseInt Integer sc.next() sc.next sc sc.close() sc.close sc int min = a / 100; min a / 100 a 100 int minRev = min / 10 % 10 * 10 + min / 100; minRev min / 10 % 10 * 10 + min / 100 min / 10 % 10 * 10 min / 10 % 10 min / 10 min 10 10 10 min / 100 min 100 int minRest = a % 100; minRest a % 100 a 100 if (minRev < minRest) {
            min++;
        } minRev < minRest minRev minRest {
            min++;
        } min++ min int max = b / 100; max b / 100 b 100 int maxRev = max / 10 % 10 * 10 + max / 100; maxRev max / 10 % 10 * 10 + max / 100 max / 10 % 10 * 10 max / 10 % 10 max / 10 max 10 10 10 max / 100 max 100 int maxRest = b % 100; maxRest b % 100 b 100 if (maxRest < maxRev) {
            max--;
        } maxRest < maxRev maxRest maxRev {
            max--;
        } max-- max int result = max - min + 1; result max - min + 1 max - min max min 1 System.out.println(result) System.out.println System.out System System.out result String args[] args public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
} public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
} Main
import java.util.*;

public class Main {

    public static void main(String args[]) {

        // 入力
        Scanner sc = new Scanner(System.in);
        int a = Integer.parseInt(sc.next());
        int b = Integer.parseInt(sc.next());
        sc.close();

        // 主処理
        int min = a / 100;
        int minRev = min / 10 % 10 * 10 + min / 100;
        int minRest = a % 100;
        if (minRev < minRest) {
            min++;
        }

        int max = b / 100;
        int maxRev = max / 10 % 10 * 10 + max / 100;
        int maxRest = b % 100;
        if (maxRest < maxRev) {
            max--;
        }

        int result = max - min + 1;

        // 出力
        System.out.println(result);
    }
}
