#include<bits/stdc++.h>
using namespace std;
int a, b, as = 0, bs = 0, s = 0, i;
int mj(int n, int y, int djw)
{
	if(n == 1)
	{
		if(djw == 1)
		{
			return 1;
		}
	}
	if(n == 0)
	{
		return 1;
	}
	int x = 0;
	for(int j = 0;j <= n - 1;j++)
	{
		if(djw == 1 && j == 0)
		{
			continue;
		}
		if(j * pow(10, i - djw) + y <= b)
		{
			x += mj(n - 1, j * pow(10, i - djw) + y, djw + 1);
		}
		
	}
	
	return x;
}
int main()
{
	cin >> a >> b;
	int a2 = a;
	while(a2)
	{
		as++;
		a2 /= 10;
	}
	int b2 = b;
	while(b2)
	{
		bs++;
		b2 /= 10;
	}
	/*
	for(i = as;i <= bs;i++)
	{
		s += mj(i, 0, 1);
	}*/
	i = 3;
	cout << mj(3, 0, 1);
	return 0;
}