#include<bits/stdc++.h>
using namespace std;
int f(long long n){
	int sum=0,a=n;
	while(a){
		sum++;
		a/=10;
	}
	return  sum;
}
bool check(long long a){
	int x=f(a),l[x]={};
	while(a){
		l[a%10]++;
		a/=10;
	}
	for(int i=0;i<x;i++){
		if(l[i]!=1)return false;
	}
	return true;
}
int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	long long a,b,cnt=0;
	cin>>a>>b;
	for(long long i=a;i<=b;i++){
		if(check(i)){
			cnt++;
		}
	}
	cout<<cnt;
	return 0;
}