#include<bits/stdc++.h>
#define int long long
#define double long double
#define debug(x) cout<<#x<<"->"<<x<<endl<<flush
#define endl '\n'
#define inf INT_MAX
using namespace std;
const int N=1e6+7;
const int M=1e6+7;
const int mod=1e9+7;
const double eps=1e-3;
bool f(int n){
	int a[11];for(int i=0;i<=9;i++)a[i]=0;
	int t=n,x=0;
	while(t){
		if(a[t%10])return 0;
		a[t%10]=1;
		t/=10;
		x++;
	}
	for(int i=0;i<x;i++)if(a[i]==0)return 0;
	return 1;
}
signed main(){
	ios::sync_with_stdio(0);
	ios_base::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int a,b;cin >>a>>b;
	int ans=0;
	for(int i=a;i<=b;i++){
		if(f(i)){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}