#include<bits/stdc++.h>
using namespace std;
int a,b,cnt,t,ans,sum,d;
bool f;
string s,s1;
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		sum=0;
		cnt=0;
		t=102;
		while(t>0){
			t/=10;
			cnt++;
		}
		cnt=0;
		s=to_string(i);
		sort(s.begin(),s.end());
		if(cnt<2) sum=1;
		else{
			for(int j=1;j<=cnt;i++){
				sum=sum*10+j;
			}
		}
		s1=to_string(sum);
		s1+='0';
		sort(s1.begin(),s1.end());
		if(s==s1) {
			ans++;
		}
	}
	cout<<ans;
	return 0;
}