#include <bits/stdc++.h>
using namespace std;

string js(string sa)
{
	int cnt = 0,x = 1;
	bool hg = 1;
	while(hg == 0)
	{
		int t = sa.find(cnt + '0');
		if(t == -1)
		{
			int t1 = sa.find(cnt + 1 + '0');
			if(t1 != -1) return 0;
			else return 1;
		}
		else
		{
			cnt++;
			int z = cnt - 1,c = 1;
			while(z > 9)
			{
				z /= 10;
				c++;
			}
			string sb = sa;
			sa = "";
			for(int i = 0;i < sb.size();i++)
			{
				if(i + 1 < t || i + 1 > t + c)
				{
					sa += sb[i];
				}
			}
		}
	}
	
}

string a[10005];

int main()
{
	int m,n,jsq = 0;
	cin >> m >> n;
	for(int i = 1;i <= n - m;i++)
	{
		a[i] = i + '0';
	}
	for(int i = 1;i <= n - m;i++)
	{
		if(js(sa) == 1) jsq++;
	}
	cout << jsq << endl;
	return 0;
}