#include <bits/stdc++.h>
using namespace std;
int pd(int n){
	if(n<10){
		return 0;
	} 
	int t=n,w=0;
	while(t!=0){
		w++;
		t/=10;
	}
	t=n;
	int s[w]={0};
	while(t!=0){
		if(t%10>=w){
			return 0;
		}
		if(s[t%10]!=0){
			return 0;
		}
		s[t%10]=1;
		t/=10;
	}
	return 1;
}
int main(){
	int a,b;
	cin>>a>>b;
	int res=0;
	for(int i=a;i<=b;i++){
		if(pd(i)==1){
			res++;
		}
	}
	printf("%d",res);
}