#include<bits/stdC++.h>
using namespace std;
bool check(int i)
{
	int i1=i,s=0;
	while(i1!=0)
	{
		s++;
		i1/=10;
	}
	for(int j=0;j<s;j++)
	{
		bool f=false;
		int ii=i;
		while(ii!=0)
		{
			int g=ii%10;
			if(g==j)
			{
				f=true;
				break;
			}
			ii/=10;
		}
		if(f==false)
		{
			return false;
			break;
		}
	}
	return true;
}
int main(){
	ios_base::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	  int a,b,s=0;
	  cin>>a>>b;
	  for(int i=a;i<=b;i++)
	  {
	  	if(check(i))
	  	{
	  		s++;
		  }
	  }
	  cout<<s;
	 return 0;
}