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

int A, B, ans = 0;
void solve(){
	cin>>A>>B;
	for(int i = A;i <= B;i++){
		int tmp1 = i, tmp2 = i, cnt = 0;
		while(tmp1 != 0){
			tmp1 /= 10;
			cnt++;
		}
		int book[cnt] = {0};
		while(tmp2 != 0){
			book[tmp2 % 10]++;
			tmp2 /= 10;
		}
		bool flag = true;
		for(int i = 0;i < cnt;i++){
			if(book[i] != 1){
				flag = false;
				break;
			}
		}
		if(flag){
			ans++;
		}
	}
	cout<<ans<<endl;
}
int main(){
	ios_base::sync_with_stdio(false);
	cin.tie(nullptr);
	cout.tie(nullptr);
	int tests = 1;
	while(tests--){
		solve();
	}
	return 0;
}