#include<bits/stdc++.h>
using namespace std;
bool xys(int n)
{
	int t[20] = {}, c = 0, m = n;
	while(n)
	{
		c++;
		n /= 10;
	}
	while(m)
	{
		int g = m % 10;
		m /= 10;
		t[g]++;
		if(g >= c) return 0;
	}
	for(int i = 0; i <= c; i++)
	{
		if(t[i] > 1) return 0;
	}
	return 1;
} 

int main()
{
	int a, b, c = 0;
	cin >> a >> b;
	for(int i = a; i <= b; i++)
	{
		if(xys(i))
		{
			c++;
		} 
	}
	cout << c;
	return 0;
}