#include<bits/stdc++.h>
using namespace std;
bool f[10];
bool islucky(int n, int t)
{
	memset(f, false, sizeof(f));
	while (n)
	{
		if (f[n % 10] || n % 10 >= t)
		{
			return false;
		}
		f[n % 10] = true;
		n /= 10;
	}
	return true;
}
int main ()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a, b;
	cin >> a >> b;
	int ans = 0;
	for (int i = a; i <= b; i++)
	{
		int t = log10(i) + 1;
		if (islucky(i, t))
		{
			ans++;
		}
	}
	cout << ans << endl;
	return 0;
}