#include<bits/stdc++.h>
using namespace std;
int n[10];
int main()
{
	int a,b,qqwe=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(i==1)
		{
			continue;
		}
		int e=i,zs=0,s;
		while(e!=0)
		{
			s=e%10;
			n[s]++;
			e/=10;
			zs++;
		}
		int ans=0;
		for(int j=0;j<=zs-1;j++)
		{
			if(n[j]==1)ans++;
			n[j]=0;
		}
		if(ans==zs)
		{
			qqwe++;
		}
		
	}
	cout<<qqwe;
	return 0;
 }