#include <bits/stdc++.h>
using namespace std;
bool f[10];
bool pd(int n) {
	memset(f, false, sizeof(f));
	int cnt = 0;
	while (n > 0) {
		cnt++;
		f[n % 10] = true;
		n /= 10;
	}
	for (int i = 0; i < cnt; i++) {
		if (!f[i]) {
			return 0;
		}
	}
	return 1;
}
int main() {
	int a, b, ans = 0;
	cin >> a >> b;
	for (int i = a; i <= b; i++) {
		if (pd(i)) {
			ans++;
		}
	}
	cout << ans;
	return 0;
}