#include<bits/stdc++.h>
using namespace std;
int a, b, ans;
map<int, int>mp;
bool Lucky(int x) {
	mp.clear();
	int t = x, cnt = 0;
	while (x) {
		cnt++;
		x /= 10;
	}
	x = t;
	while (x) {
		if (x % 10 > cnt - 1) return 0;
		mp[x % 10]++;
		x /= 10;
	}
	if (mp.size() == cnt) return 1;
	return 0;
}
int main() {
	scanf("%d %d", &a, &b);
	for (int i = a; i <= b; i++) {
		if (Lucky(i)) ans++;
	}
	cout << ans;
}