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

int l, r, fl, ans;
string s, pd;

string zh(int x)
{
	string ans = "";
	while(x != 0)
	{
		ans = ans + char(x % 10 + '0');
		x /= 10;
	}
	return ans;
}

int main()
{
	ios::sync_with_stdio(false);
	cin.tie(0);
	cout.tie(0);
	cin >> l >> r;
	for(int i = l; i <= r; i++)
	{
		fl = 1;
		s = zh(i);
		sort(s.begin(), s.end());
		if(s[0] != '0') continue;
		for(int j = 1; j < (int)s.size(); j++)
		{
			if(s[j] != char(s[j - 1] + 1)) fl = 0;
		}
		if(fl == 1) ans++;
	}
	cout << ans << "\n";
	return 0;
}