#include <iostream>
using namespace std;

signed int a , b;
signed int ans;

bool check(int x)
{
	signed int numTimes[10] = {0};
	int tx = x;
	int dig = 0;
	while (tx)
	{
		numTimes[(tx % 10)] ++;
		tx /= 10;
		dig ++;
	}
	for (int i = 0 ; i <= dig - 1 ; i ++)
	{
		if (numTimes[i] != 1)
		{
			return false;
		}
	}
	return true;
}

signed int main()
{
	ios::sync_with_stdio(false);
	cin.tie(nullptr) , cout.tie(nullptr);
	cin >> a >> b;
	for (int i = a ; i <= b ; i ++)
	{
		if (check(i))
		{
//			cout << i << endl;
			ans ++;
		} 
	}
	cout << ans;
	return 0;
}