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

bool b[10];

bool xy(int x){
	memset(b,false,sizeof(b));
	int w=0;
	while(x!=0){
		b[x%10]=true;
		w++;
		x/=10;
	}
	for(int i=0;i<=w-1;i++){
		if(!b[i]){
			return false;
		}
	}
	return true;
}

int main(){
	int a,b,ans=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(xy(i)){
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}