#include<bits/stdc++.h>
using namespace std;
bool check(string s)
{
	if (s[0] != '0')
	{
		return false;
	}
	for (int i = 1 ; i < s.size() ; i++)
	{
		if (s[i] != s[i - 1] + 1)
		{
			return false;
		}
	}
	return true;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0),cout.tie(0);
	int n,m,c = 0;
	cin >> n >> m;
	for (int i = n ; i <= m ; i++)
	{
		string s = to_string(i);
		sort(s.begin(),s.end());
		if (check(s))
		{
			c++;
		}
	}
	cout << c << '\n';
	return 0;
}