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