#include<bits/stdc++.h>
using namespace std;
int n[1000005];
bool pd(int x){
	int tx=x,c=0;
	while(tx!=0){
		tx/=10;
		c++;
	}
	int g;
	while(x!=0){
		g=x%10;
		x/=10;
		n[g]++;
		if(n[g]>1||g>c-1) return false;
	}
	return true;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	int a,b,c=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		memset(n,0,sizeof(n));
		if(pd(i)==true) c++;
	} 
	cout<<c;
	return 0;
}