//p1.cpp
#include<bits/stdc++.h>
using namespace std;
set<int>v;
bool fot(int n)
{
	v.clear();
	int c=n,d=n,i=0;
	while(c>0)
	{
		v.insert(i);
		i++;
		c/=10;
	}
	while(d>0)
	{
		if(!v.count(d%10))return false;
		v.erase(d%10);
		d/=10;
	}
	return 1;
}
signed main()
{
	ios::sync_with_stdio(0);cin.tie(0);
	int a,b,cnt=0;
	cin >> a >> b;
	for(int i=a;i<=b;i++)
		if(fot(i)){cnt++;}
	cout << cnt << "\n";
	return 0;
}