#include <bits/stdc++.h>
using namespace std;
int a, b, ans, vis[10];
bool check(int x){
	int cnt = 0;
	while(x){
		vis[x % 10]++;
		x /= 10;
		cnt++;
	}
	int k = 0;
	for(int i = 0; i < cnt; i++){
		if(vis[i])k++;
	}
	if(cnt == k)return 1;
	return 0;
}
int main(){
	ios::sync_with_stdio(0);
	cin >> a >> b;
	for(int i = a; i <= b; i++){
		for(int j = 0; j <= 9; j++)vis[j] = 0;
		if(check(i))ans++; 
	}
	cout << ans << endl;
	return 0;
}