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

int a,b,ans,c[10],maxn,t;

int main(){
	ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
	//Do not need freopen;
	cin >> a >> b;
	for (int i = a;i <= b;i++){
		int x = i;
		memset(c,0,sizeof (c));
		maxn = 0;
		while (x){
			c[x % 10]++;
			maxn = max(maxn,x % 10);
			x /= 10;
		}
		t = 1;
		for (int i = 0;i <= maxn;i++){
			if (c[i] != 1){
				t = 0;
				break;
			}
		}
		if (t){
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}