#include<bits/stdc++.h>
#define ll long long
#define endl "\n"
using namespace std;
int cnt[10];
int main(){
//  freopen(".in","r",stdin);
//  freopen(".out","w",stdout);
	ll a,b; cin >> a >> b;
	ll sum = 0;
	for(int t = a;t <= b;t++){
		ll x = t;
		memset(cnt,0,sizeof cnt);
		int p = 0;
		while(x){
			p++,cnt[x%10]++,x/=10;
		}
		bool f = true;
		for(int i = 0;i < p;i++){
			if(cnt[i]>1||cnt[i]==0){
				f = false;
				break;
			}
		}
		if(f)	sum++;
	}
	cout << sum;
	return 0;
}