#include <bits/stdc++.h>
using namespace std;
#define endl '\n'
typedef long long ll;
typedef int ii;
typedef char cc;
typedef double dd;
typedef bool bb;
typedef string ss;
typedef void vv;
typedef long double ld;
bb a[15];
bb check(ll n){
	memset(a,0,sizeof a);
	if(n==0)return 0;
	ll x=0;
	do{
		a[n%10]++;
		if(a[n%10]>=2)return 0;
		n/=10;
		x++;
	}
	while(n);
	for(ll i=0;i<x;i++){
		if(a[i]!=1)return 0;
	}
	return 1;
}
ii main(){
	//freopen(".in","r",stdin);
	//freopen(".out","w",stdout);
	ll n,m,sum=0;
	cin>>n>>m;
	for(ll i=n;i<=m;i++){
		if(check(i))sum++;
	}
	cout<<sum;
}