#include <bits/stdc++.h>
using namespace std;
int n, m, a[7];
bool b[10];
bool pd(int n)
{
	string s = "";
	int i = 0;
	while(n != 0)
	{
		i++;
		a[i] = n % 10;
		b[n % 10] = 1;
		s = (n % 10 + '0')+ s;
		n /= 10;
	}
	if(s[0] == 0 && s != "0") return 0;
	for (int j = i; j <= n - 1; j++)
		if(b[j] == 0) return 0;
	return 1;
}
int main()
{
	cin >> n>> m;
	int jsq = 0;
	for (int i = n; i <= m; i++)
		if(pd(i) != 0) jsq++;
	cout << jsq<< endl;
	return 0;
}