#include<bits/stdc++.h>
using namespace std;
const int N = 1e6 + 10;
int tong[N];
bool check(int x){
    int cnt = 0;
	while(x){
		tong[x%10]++;
		cnt++;
		x /= 10;
	}
	for(int i = 0; i < cnt; i++){
		if(tong[i] != 1){
			return false;
		}
	}
	return true;
}
int main(){
	cin.tie(0);
	cout.tie(0);
	int l, r;
	int sum = 0;
	cin >> l >> r;
	for(int i = l; i <= r; i++){
		for(int j = 0; j <= 11; j++) tong[j] = 0;
		if(check(i)){
			
			sum++;
		}
	}
	cout << sum;
	return 0;
}