#include <bits/stdc++.h>
using namespace std;
int ws(int n)
{
	int ans=0;
	while(n>0)
	{
		n/=10;
		ans++;
	}
	return ans;
}
string zh(int n)
{
	string s="";
	while(n>0)
	{
		int g=n%10;
		s=char(g+48)+s;
		n/=10;
	}
	return s;
}
bool pd(int ws,int n)
{
	for(int i=0;i<ws;i++)
	{
		string s=zh(n);
		bool f=0;
		for(int j=0;j<s.size();j++)
		{
			if(s[j]-'0'==i)
			{
				f=1;
				break;
			}
		}
		if(f==0)return 0;
	}
	return 1;
}
signed main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int a,b,cnt=0;
	cin>>a>>b;
	for(int i=a;i<=b;i++)
	{
		if(pd(ws(i),i))cnt++;
	}
	cout<<cnt;
	return 0;
}