#include <bits/stdc++.h>

using namespace std;

typedef unsigned long long ull;

vector<ull> lol;
ull cur = 0;

void rec(int len, int last) {
    lol.push_back(cur);
	if (len == 18) return;
	for (int i = last; i < 10; i++) {
		cur = cur * 10 + i;
		rec(len + 1, i);
		cur /= 10;
	}
	return;
}
 
int main() {
    ifstream in("numbers.in");
    ofstream out("numbers.out");
    ull l, r, ans = 0;
    
    in >> l >> r;
    rec(0, 1);
    for (auto x: lol) {
    	ans += (l <= x) && (x <= r);
    }
    out << ans;
    return 0;
}
