#include <bits/stdc++.h>
using namespace std;
#define LL long long
const int N = 1e6 + 10;
int a, b, ans;
int h[N];
bool check(int n) {
	string s = "";
	while (n != 0) {
		s += (n % 10 + '0');
		n /= 10;
	}
	reverse(s.begin(),s.end());
	for (int i = 0; i < s.size(); i++) {
		h[s[i] - '0'] = 1;
	}
	for (int i = 0; i < s.size(); i++) {
		if (h[i] == 0) return 0;
	}
	for (int i = s.size(); i <= 9; i++) {
		if (h[i] == 1) return 0;
	}
	return 1;
}
int main() {
	ios_base::sync_with_stdio(false);
	cin.tie(0); cout.tie(0);
	cin >> a >> b;
	for (int i = a; i <= b; i++) {
		for (int i = 0; i <= 9; i++) h[i] = 0;
		if (check(i)) {
			ans++;
		}
	}
	cout << ans << '\n'; 
	return 0;
}