#include <bits/stdc++.h>

using namespace std;

bool is_Lucky(int x)
{
	int cnt = 0;
	bool a[8];
	memset(a,false,sizeof(a));
	while(x)
	{
		cnt++;
		a[x%10] = true;
		x/=10;
	}
	for(int i = 0; i<cnt; i++)
	{
		if(!a[i])
		{
			return false;
		}
	}
	return true;
}

int main()
{
	int n,m;
	cin >> n >> m;
	int cnt = 0;
	for(int i = n; i<=m; i++)
	{
		if(is_Lucky(i))
		{
			cnt++;
		}
	}
	cout << cnt;
	return 0;
}