#include<bits/stdc++.h>
using namespace std;
int a, b, sum;
bool lucky(int x){
	int t = 0;
	bool cc[10];
	for(int i = 0; i < 10; i++) cc[i] = false;
	for(int i = x; i != 0; i /= 10){
		t += 1;
		cc[i % 10] = true;
	}
	
	for(int i = 0; i < t; i++){
		if(cc[i] == false) return false;
	}
	return true;
}
int main(){
	cin >> a >> b;
	for(int i = a; i <= b; i++){
		if(lucky(i)) sum += 1;
	}
	cout << sum;
	
	return 0;
}