#include<bits/stdc++.h> 
using namespace std;
int main(){
	int a,b,c=0;
	bool luck=true;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		luck=true;
		int tmp=i,len=0,g=0;
		while (tmp){
			tmp/=10;
			len++;
		} 
		tmp=i;
		int tf[len]={0};
		while (tmp){
			g=tmp%10;
			for (int j=0;j<len;j++){
				if (g==j){
					tf[g]=1;
				}
			}
			tmp/=10;
		}
		for(int j=0;j<len;j++){
			if (tf[j]==0){
				luck=false;
				break;
			}
		}
		if (luck){
			c++;
		}
	} 
	cout<<c<<endl;
	return 0;
}