#include<bits/stdc++.h>
typedef long long ll;
using namespace std;
ll a,b,cnt,bucket[20];
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		bool f=1;
		memset(bucket,0,sizeof(bucket));
		ll n=i,shuwei=0;
		do{
			bucket[n%10]++;
			n/=10;
			shuwei++;
		}while(n);
		cnt++;
		for(int j=0;j<shuwei;j++){
			if(bucket[j]!=1){
				cnt--;
				break;
			}
		}
	}
	cout<<cnt;
	return 0;
}