#include <bits/stdc++.h>
using namespace std;
int a,b,ans;
bool c[20];
bool pd(int x)
{
	int y=x,cnt=0;
	while(y>0)
	{
		y/=10;
		cnt++;
	}
	while(x>0)
	{
		int o=x%10;
		c[o]++;
		x=x/10;
	}
//	for(int i=0;i<cnt;i++) cout<<c[i]<<" ";
//	cout<<endl;
	for(int i=0;i<cnt;i++) if(c[i]!=1) return 0;
	return 1;
}
int main()
{
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		for(int j=0;j<=10;j++) c[j]=0;
//		cout<<i<<endl;
		if(pd(i))
		{
//			cout<<i<<endl;
			ans++;
		}
	}
	cout<<ans<<endl;
	return 0;
}