#include<bits/stdc++.h>
using namespace std;
int n,m,ans=0,t[10];
bool check(int x){
	memset(t,0,sizeof(t));
	int w=0;
	while(x){
		w++;
		t[x%10]++;
		x/=10;
	} 
	for(int i=0;i<w;i++){
		if(t[i]!=1) return false;
	} 
	return true;
}
int main(){
	cin>>n>>m;
	for(int i=n;i<=m;i++){
		if(check(i)){
			//cout<<i<<endl;
			ans++;
		}
	}
	cout<<ans;
	return 0;
}