#include<bits/stdc++.h>
using namespace std;
bool h[15]={0};
bool s(int a){
	int l=0;
	while(a>0){
		l++;
		h[a%10]=1;
		a/=10;
}
	for(int i=0;i<l;i++){
		if(h[i]==0){
			for(int u=0;u<10;u++){
				h[u]=0;
			}
			return 0;
		}
		else{
			h[i]=0;
		}
	}
	return 1;
}
int main()
{
	int a,b,d=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(s(i)==1){
			d++;
			//cout<<i<<endl;
		}
	}
	cout<<d;
	return 0;
}