#include<bits/stdc++.h>
using namespace std;
bool vis[10];
int wei(int x)
{
	if(x>999999) return 7;
	else if(x>99999) return 6;
	else if(x>9999) return 5;
	else if(x>999) return 4;
	else if(x>99) return 3;
	else if(x>9) return 2;
	return 1;
}
bool check(int x)
{
	memset(vis,0,sizeof(vis));
	int t=x;
	while(t)
	{
		vis[t%10]=1;
		t/=10;
	}
	for(int i=0;i<wei(x);i++)
	{
		if(!vis[i]) return 0;
	}
	return 1;
}
int main()
{
	int a,b,ans=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(check(i)) ans++;
	}
	cout<<ans<<endl;
	return 0;
}