#include <bits/stdc++.h>
using namespace std;

int d[10],cnt[6];

int main() {
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	
	//freopen("p1.in","r",stdin);
	//freopen("p1.out","w",stdout);
	int a,b,ans = 0;
	cin >> a >> b;
	for(int i = a;i <= b;i++) {
		int len = 0;
		bool t = true;
		memset(cnt,0,sizeof(cnt));
		int ii = i;
		while(ii > 0) {
			cnt[ii % 10]++;
			ii /= 10;
			len++;
		}
		for(int j = 0;j < len;j++) {
			if(cnt[j] != 1) {
				t = false;
				break;
			}
		}
		if(t) ans++;
	}
	cout << ans << endl;
	return 0;
}