#include <bits/stdc++.h>
using namespace std;
int a[10];
bool check(int n)
{
	memset(a,0,sizeof(a));int cnt=0;
	while(n!=0)
	{
		a[n%10]++;
		n/=10;cnt++;
	}
	for(int i=0;i<cnt;i++)
	{
		if(a[i]!=1) return false;
	}
	return true;
 } 
int main()
{
	int a,b;
	cin>>a>>b;int cnt=0;
	for(int i=a;i<=b;i++)
	{
		cnt+=int(check(i));
	}
	cout<<cnt;
	return 0;
}