#include <bits/stdc++.h>
using namespace std;
bool s[10];// ʾλΪiӦе
int qws(int x)//жxǼλ
{
	int t;
	while(x!=0)
	{
		x/=10;
		t++;                                                                     
	}
	return t;
} 
int main(){
	int a,b;
	cin >>a>>b;
	int cnt=0;
	for(int i=a;i<=b;i++)
	{
		memset(s,false,sizeof(s));
		int i2=i;
		int t;
		bool flag=true;
		while(i2!=0)
		{
			t=i2%10;
			i2/=10;
			if(t>=qws(i))
			{
				flag=false;
				break;
			}
			if(s[t]==true)
			{
				flag=false;
				break;
			}
			else
			{
				s[t]=true;
			}
		}	
		if(flag==true)
		{
			cnt++;
		}
	}
	cout<<cnt;
	return 0;
}