#include<bits/stdc++.h>
using namespace std;
bool vis[10 + 2];
string to__string(int x){
	string s;
	while(x){
		s += x % 10 + '0';
		x /= 10;
	}
	return s;
}
bool check(int x){
	memset(vis , 0 , sizeof(vis));
	int y = x , len = 0;
	while(y){
		len++;
		y = y / 10;
	}
	string s = to__string(x);
	for(int i = 0 ; s[i] ; ++i){
		vis[s[i] - '0'] = 1;
	}
	for(int i = 0 ; i < len ; ++i){
		if(!vis[i]) return 0;
	}
	return 1;
}
int main(){
	int x , y , cnt = 0;
	cin>>x>>y;
	for(int i = x ; i <= y ; ++i){
		if(check(i)){
			cnt++;
		}
	} 
	cout<<cnt;
	return 0;
}