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

bool islucky(int n)
{
	int t[8];
	string s;
	while (n)
	{
		s += n % 10 + '0';
		n /= 10; 
	}
	reverse(s.begin(), s.end());
	if (s[0] == '0') return 0;
	for (int i = 0; i < s.size(); i++)
		t[i] = s[i] - '0';
	sort(t, t + s.size());
	for (int i = 0; i < s.size(); i++)
		if (t[i] != i) return 0;
	return 1;
}

int main()
{
	int a, b, cnt = 0;
	scanf("%d %d", &a, &b);
	for (int i = a; i <= b; i++)
		if (islucky(i)) cnt++;
	printf("%d\n", cnt);
	return 0;
}