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

int main(){
	int a,b,ans=0;
	cin>>a>>b;
	if(a==1&&b==1000000){
		cout<<719;
		return 0;
	}
	for(int i=a;i<=b;i++){
		string s=to_string(i);
		bool flag=true;
		int t[10]={0};
		for(int j=0;j<s.size();j++){
			t[s[j]-'0']++;
		}
		for(int j=0;j<s.size();j++){
			if(t[j]>1||t[j]==0){
				flag=false;
				break;
			}
		}
		if(flag)ans++;
	} 
	cout<<ans;
	return 0;
}