#include<bits/stdc++.h>
using namespace std;
int main(){
	//freopen("p1.in","r",stdin);
	//freopen("p1.out","w".stdout);
	long long a,b,ans=0,g=0;
	cin>>a>>b;
	for(long long i=a;i<=b;i++){
		long long t=i,cnt=0;
		while(t){
			t/=10;
			cnt++;
		}
		t=i;
		long long f[t];
		for(int j=0;j<cnt;j++){
			f[j]=t%10;
			t/=10;
		}
		sort(f,f+cnt);
		for(int j=0;j<cnt;j++){
			if(f[j]!=j){
				g=1;
				break;
			}
		}
		if(g==0){
			ans++;
		}
		g=0;
	}
	cout<<ans;
	return 0;
}