#include"bits/stdc++.h"
using namespace std;
bool judge(int n){
	bool flag[10]={0};
	int k=n;
	int c=0;
	while(k!=0){
		k/=10;
		c++;
	}
	//c:cnt_num
	while(n!=0){
		int temp=n%10;
		if(flag[temp]==1) return 0;
		else if(temp>=c) return 0;
		else flag[temp]=1;
		n/=10;
	}
	for(int i=0;i<c;i++){
		if(flag[i]==0) return 0;
	}
	return 1;
}
int a,b,cnt;
int main(){
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(judge(i)) cnt++;
	}
	cout<<cnt;
}
//1023 1023