#include<bits/stdc++.h>

//#define int long long
using namespace std;
typedef long long ll;

void precalc(){
	
}
void solve(){
	int a,b;
	cin>>a>>b;
	int ans=0;
	for(int i=a;i<=b;i++){
		string s=to_string(i);
		map<char,bool> mp;
		bool flag=1;
		for(int j=0;j<s.size();j++){
			int c=s[j]-'0';
			if(c>s.size()-1||mp[c]){
				flag=0;
				break;
			}
			mp[c]=1;
		}
		ans+=flag; 
	}
	cout<<ans;
}
signed main(){
//	freopen("input.txt","r",stdin);
//	freopen("output.txt,"w",stdout);
//	ios::sync_with_stdio(0);
//	cin.tie(0);
//	cout.tie(0);
	precalc();
	int T=1;
//	cin>>T;
	while(T--){
		solve();
	}
	return 0;
}