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