#include <bits/stdc++.h>
using namespace std;
int pd(int n)
{
	int i=0,a[100005],l=n;
	while(l!=0)
	{
		i++;
		int g=l%10;
		a[i]=g;
		l/=10;
	}
	sort(a+1,a+i+1);
	if(a[1]!=0) return 0;
	int f=1;
	for(int j=1; j<=i-1; j++) if(a[j+1]-a[j]!=1) f=0;
	if(f==1) return 1;
	else return 0;
}
int main()
{
	ios::sync_with_stdio(0);
	cin.tie(0);
	cout.tie(0);
	int a,b,ans=0;
	cin>>a>>b;
	for(int i=a; i<=b; i++) 
	{
		if(pd(i)==1) ans++;
	}
	cout<<ans;
	return 0;
}