#include<bits/stdc++.h>
using namespace std;
int a,b,ans;
bool p(int x){
	int t[10]={},w=0;
	while(x!=0){
		int g=x%10;
		t[g]++;
		w++;
		x/=10;
	}
	for(int i=0;i<w;i++){
		if(t[i]!=1)return false;
	}
	return true;
}
int main(){
	ios::sync_with_stdio(0);
	cin.tie(0);cout.tie(0);
	cin>>a>>b;
	for(int i=a;i<=b;i++){
		if(p(i))ans++;
	}
	cout<<ans;
	return 0;
}