#include <bits/stdc++.h>

using namespace std;

bool check(string s) {
	for (size_t i = 1; i < s.length(); i++)
		if (s[i - 1] > s[i]) return false;
	return true;
}

int main() {
    ifstream in("numbers.in");
    ofstream out("numbers.out");
    int l, r, ans = 0;
    in >> l >> r;

    for (int i = l; i <= r; i++) {
    	ans += check(to_string(i));
    }
    out << ans;
    return 0;
}
