#include <bits/stdc++.h>
using namespace std;
int c[17];
bool xys(int n)
{
	for(int i=0;i<=17;i++)
	{
		c[i] = 0;
	}
	int w = 0;
	while(n!=0)
	{
		int g = n%10;
		w++;
		c[g] = 1;
		n = n/10;	
	}
	for(int i=0;i<=w-1;i++)
	{
		if(c[i]!=1)
		{
			return false;
		}
	}
	return true;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	int a,b;
	cin>>a>>b;
	int gs = 0;
	for(int i=a;i<=b;i++)
	{
		if(xys(i)==true)
		{
			gs++;
		}
	}		
	cout<<gs;
	return 0;
}