#include <bits/stdc++.h>
using namespace std;

int i, a, b, c, s, d[10];

int main()
{
	cin >> a >> b;
	for (; a <= b; a++)
	{
		i = a;
		c = 0;
		memset(d, 0, sizeof(d));
		while(i != 0)
		{
			d[i % 10]++;
			i /= 10;
			c++;
		}
		for (i = 0; i < c; i++)
			if (d[i] != 1)
				break;
		if (i == c)
			s++;
	}
	cout << s;
	return 0;
}