#include<bits/stdc++.h>
using namespace std;
int num[15];
int size(int x){
	if(x>=1 && x<=9) return 1;
	else if(x>=10 && x<=99) return 2;
	else if(x>=100 && x<=999) return 3;
	else if(x>=1000 && x<=9999) return 4;
	else if(x>=10000 && x<=99999) return 5;
	else if(x>=100000 && x<=999999) return 6;
	else if(x>=1000000 && x<=9999999) return 7;
}
bool check(int x){
	int len=size(x);
	while(x){
		num[x%10]++;
		x/=10;
	}
	for(int i=0;i<len;i++){
		if(num[i]!=1) return 0;
	}
	return 1;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);cout.tie(0);
	int a,b,cnt=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		memset(num,0,sizeof(num));
		if(check(i)) cnt++; 
	}
	cout<<cnt;
	return 0;
}