#include <bits/stdc++.h>
using namespace std;
bool b[15];
bool pd(string x){
	for(int i=0; i<x.size(); i++){
		if(int(x[i]-48)>x.size()-1||b[x[i]-48]==false){
			return false;
		}
		b[x[i]-48]=false;
	}
	return true;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int n,m,f=0,sum=0;
	string x;
	cin>>n>>m;
	for(int i=n; i<=m; i++){
		x=to_string(i);
		f=0;
		b[0]=true;
		b[1]=true;
		b[2]=true;
		b[3]=true;
		b[4]=true;
		b[5]=true;
		b[6]=true;
		b[7]=true;
		b[8]=true;
		b[9]=true;
		if(pd(x)==true){
			sum++;
		}
	}
	cout<<sum<<'\n';
	return 0;
}