import java.io.File;
import java.io.FileNotFoundException;
import java.io.PrintWriter;
import java.util.Scanner;

/**
 * Created by chavit on 26.10.2015.
 */
public class numbers_answertime_vd {

    public static void main(String[] args) throws FileNotFoundException {
        new numbers_answertime_vd().run();
    }

    private void run() throws FileNotFoundException {
        Scanner in = new Scanner(new File("numbers.in"));
        PrintWriter out = new PrintWriter("numbers.out");
        out.println(getAnswer(in.next(), in.next()));
        out.close();
    }

    public long getAnswer(String l, String r) {
        int len = r.length();
        int[] lower = stringToArray(l, len);
        int[] upper = stringToArray(r, len);
        int answer = countFine(lower, upper, true, true, 0, 0);
        return answer;
    }

    public int countFine(int[] lower, int[] upper, boolean prefixAsInLower, boolean prefixAsInUpper,
                         int previousDigit, int position) {
        if (position == lower.length) {
            return 1;
        }
        int from = Math.max(previousDigit, prefixAsInLower ? lower[position] : 0);
        int to = prefixAsInUpper ? upper[position] : 9;
        int ans = 0;
        for (int digit = from; digit <= to; digit++) {
            ans += countFine(lower, upper, prefixAsInLower & (digit == lower[position]),
                    prefixAsInUpper & (digit == upper[position]), digit, position + 1);
        }
        return ans;
    }

    private int[] stringToArray(String number, int len) {
        int[] numberArray = new int[len];
        for (int i = 0; i < number.length(); i++) {
            numberArray[i + len - number.length()] = number.charAt(i) - '0';
        }
        return numberArray;
    }
}
