#include<bits/stdc++.h>
using namespace std;
long long a,b;
long long cnt;
bool flag;
int main(){
	scanf("%lld%lld",&a,&b);
	for(int i=a;i<=b;i++){
		int c[10];
		for(int j=0;j<10;j++)c[j]=0;
		int t=i;
		int wei=0;
		while(t){
			wei++;
			c[t%10]++;
			t/=10;
		}
		bool flag=true;
		//cout<<i<<":";
		for(int j=0;j<wei;j++){
			if(c[j]!=1){
				flag=false;
				break;
			}
			//cout<<c[j]<<" ";
		}
		//if(flag==true)cout<<"TRUE";
		//else cout<<"FALSE";
		//cout<<endl;
		if(flag==true){
			cnt++;
			//cout<<i<<endl;
		}
	}
	cout<<cnt;
	return 0;
}