#include<bits/stdc++.h>
using namespace std;
int dight(int j)
{
	int x=0;
	while(j!=0)
	{
		j/=10;
		x++;
	}
	return x;
}
bool xw(int j)
{
	int c=dight(j);
	int d[c]={0};
	while(j!=0)
	{
		d[j%10]++;
		j/=10;
	}
	for(int i=0;i<c;i++)
	{
		if(d[i]!=1)
			return false;
	}
	return true;
}
int main()
{
	int a,b,x=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
		if(xw(i))
			x++;
	cout<<x;
    return 0;
}