#include<bits/stdc++.h>
using namespace std;
long long a,b,ret;
long long check(long long x)
{
	long long c[111];
	long long tot=0;
	while(x>=1)
	{
		c[++tot]=x%10;
		x/=10;
	}
	sort(c+1,c+1+tot);
	for(long long i=0;i<tot;i++)
	{
		if(c[i+1]!=i)
		{
			return 0;
		}
	}
	return 1;
}
int main()
{
	scanf("%lld %lld",&a,&b);
	for(long long i=a;i<=b;i++)
	{
		if(check(i)==1)
		{
			
			ret++;
		}
	}
	
	printf("%lld",ret);
	return 0;
 }