#include<bits/stdc++.h>//Ô¤¹À£ºAC 
using namespace std;
bool pd(int x){
	int a[1005];
	int wei=0;
	while(x){
		wei++;
		a[wei]=x%10;
		x/=10;
	}
	bool sb;
	for(int i=0;i<wei;i++){
		sb=false;
		for(int j=1;j<=wei;j++){
			if(a[j]==i){
				a[j]=-1;
				sb=true;
				break;
			}
		}
		if(sb==false){
			return false;
		}
	}
	return true;
}
int main(){
	int a,b,cnt=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(pd(i)==true){
			cnt++;
		}
	}
	cout<<cnt;
	return 0;
}