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

bool check(int n){
	vector<int> a;
	while(n>0){
		a.push_back(n%10);
		n/=10;
	}
	sort(a.begin(),a.end());
	for(int i=0;i<a.size();i++){
		if(a[i]!=i){
			return 0;
		}
	}
	return 1;
}

int main(){
	int l,r,s=0;
	cin>>l>>r;
	for(int i=l;i<=r;i++){
		s+=check(i);
	}
	cout<<s;
	return 0;
}