#include<bits/stdc++.h>
using namespace std;

#define ll long long
#define ull unsigned long long
int n,m,k,l,r,t,q;

bool check(int i){
	int a[10],len=0;
	memset(a,0,sizeof a);
	while(i){
		a[++len]=i%10;
		i/=10;
	}
	sort(a+1,a+len+1);
	for(int j=1;j<=len;j++){
		if(a[j]!=j-1) return 0;
	}
	return 1;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);
	cin>>n>>m;
	for(int i=n;i<=m;i++){
		if(check(i)) t++;
	}
	cout<<t<<endl;
}