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_linear_vd {
    private void run() throws FileNotFoundException {
        Scanner in = new Scanner(new File("numbers.in"));
        PrintWriter out = new PrintWriter("numbers.out");
        out.println(getAnswer(in.nextInt(), in.nextInt()));
        out.close();
    }

    public int getAnswer(int l, int r) {
        int ans = 0;
        for (int i = l; i<=r; i++) {
            if (fine(Integer.toString(i))) {
                ans++;
            }
        }
        return ans;
    }

    private boolean fine(String number) {
        for (int i = 1; i < number.length(); i++) {
            if (number.charAt(i) < number.charAt(i - 1)) {
                return false;
            }
        }
        return true;
    }

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