#include<bits/stdc++.h>
using namespace std;
bool check(int n)
{
	int a[10];
	memset(a,0,sizeof(a));
	int shu = 0;
	while(n)
	{
	    int yu = n % 10;
	    a[yu]++;
	    n /= 10;
	    shu ++;
	}

	for(int i = 0; i < shu; i++)
	{
		if(a[i] != 1)return false;
	 } 
	return true;
}
int main()
{
//	check(120);
	int n,m;
	cin >> n >> m;
//	if(check(120) == true)cout << check(120);

	int ans = 0;
	for(int i = n ; i <= m; i++)
	{
		if(check(i) == true)ans++;
	}
	cout << ans;

	return 0;	
}