#include<bits/stdc++.h>
using namespace std;
string x;
int weishu(int n){
	int ans=0;
	while(n>0){
		ans++;
		x.push_back(n%10+'0');
		n/=10;
	}
	return ans;
} 
int main()
{
	ios::sync_with_stdio();
	cin.tie(0);
	cout.tie(0);
	int a,b;
	cin>>a>>b;
	int ans=0;
	for(int i=a;i<=b;i++){
		x.clear();
		int k=weishu(i);
		bool flag=true;
		for(int j=0;j<k;j++){
			bool leap=false;
			for(int ii=0;ii<x.size();ii++){
				if(x[ii]==j+'0'){
					leap=true;
					break;
				}
			}
			if(leap==false){
				flag=false;
				break;
			}
		}
		if(flag==true){
			ans++;
		}
	}
	cout<<ans;
	return 0;
}