#include<bits/stdc++.h>
using namespace std;
#define int long long
int a,b,c[10],s;
signed main(){
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		int t=i,l=0,f=0,k=0;
		while(t!=0){
			c[t%10]++;
			t=t/10;
			l++;
		}
		for(int j=0;j<l;j++){
			if(c[j]!=1){
			k=1;
			break;
			}	
			f+=c[j];
		}
		if(f==l&&k==0) s++;
	for(int y=0;y<=9;y++) c[y]=0;
	}
	cout<<s<<endl;
	return 0;
}