#include<iostream>
using namespace std;
bool check(int x)
{
	int xx = x;
	int len = 0;
	int a[11] = {};
	while(xx > 0)
	{
		a[xx % 10] ++;
		xx /= 10;
		len ++;
	}
//	cout << x << " ";
	for(int i = 0;i < len;i ++)
	{
//		cout << a[i] << " ";
		if(a[i] == 0)
		{
//			cout << endl;
			return 0;
		}
	}
	for(int i = len + 1;i <= 10;i ++)
	{
//		cout << a[i] << " ";
		if(a[i] != 0)
		{
//			cout << endl;
			return 0;
		}
	}
//	cout << endl;
	return 1;
}

int main()
{
	int a, b;
	cin >> a >> b;
	int cnt = 0;
	for(int i = a;i <= b;i ++)
	{
		if(check(i))
		{
//			cout << i << endl;
			cnt ++;
		}
	}
	cout << cnt;
}