//p1.cpp
#include<bits/stdc++.h>
using namespace std;
int a[15];
bool pd(int n){
	memset(a,0,sizeof(a));
	int t=n,w=0;
	while(t){
		w++;
		t/=10;
	}
	while(n){
		if(n%10>=w){
			return false;
		}
		if(a[n%10]==1){
			return false;
		}
		a[n%10]=1;
		n/=10;
	}
	return true;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int a=1,b=1000000,cnt=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(pd(i)){
			cnt++;
//			cout<<i<<'\n';
		}
	}
	cout<<cnt;
	return 0;
}