#include <bits/stdc++.h>
using namespace std;
int a,b;
int ans;
int getws(int n)
{
	int res=0;
	while(n)
	{
		n/=10;
		res++;
	}
	return res;
}
bool check(int n)
{
	map<int,bool> mp;
	int res=getws(n);
//	cout<<res<<endl;
	while(n)
	{
		int t=n%10;
		if(t>(res-1)) return 0;
		if(mp[t]) return 0;
		mp[t]=1;
		n/=10;
	}
	return 1;
}
int main()
{
	cin>>a>>b;
	for(int i=a;i<=b;++i)
	{
		if(check(i))
		{
			ans++;
//			cout<<i<<endl;
		}
	} 
	cout<<ans<<endl;
//	cout<<check(103)<<endl;
	return 0;
}