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


bool isluck(int n){
	bool appn[10]={0,0,0,0,0,0,0,0,0,0}; 
	int length = 0;
	while(n!=0){
		if(appn[n%10]){
			return false;
		}else{
			appn[n%10] = true;
		}
		n /= 10;
		length++;
	} 
	for(int i=0;i<length;i++){
		if(!appn[i]){
			return false;
		}
	}
}

int main(){
	ios::sync_with_stdio(0);
	cin.tie(NULL);
	cout.tie(NULL);
	int a,b,ans=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(isluck(i)){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}