#include <bits/stdc++.h>
using namespace std;
bool f[10];
int ws(int n)
{
	int s = 0;
	while (n != 0)
	{
		s++;
		n /= 10;	
	}	
	return s;
} 
bool check(int n)
{
	memset(f, 0, sizeof(f));
	int t = ws(n);
	t--;
	while (n != 0)
	{
		int ge = n % 10;
		f[ge] = 1;
		n /= 10;
		if (ge > t) return 0;
	}
	for (int i = 0; i <= t; i++)
		if (!f[i]) return 0;
	return 1; 
}
int main()
{
	int a, b; cin >> a >> b;
	long long ans = 0;
	for (int i = a; i <= b; i++)
		if (check(i)) ans++;
	cout << ans << endl;
	return 0;
}