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

int main()
{
	int a,b,cnt = 0;
	cin >> a >> b;
	
	for (int i = a;i <= b;i++)
	{
		int d = i,e = 0;
		while (d)
		{
			e++;
			d /= 10;
		}
		int c[e + 1],k = e;
		d = i;
		while (d)
		{
			c[k--] = d % 10;
			d /= 10;
		}
//		for (int i = 1;i <= e;i++)
//		{
//			cout << c[i];
//		}
//		cout << endl;
		sort (c + 1,c + 1 + e);
		bool f = 1;
		for (int i = 1;i <= e;i++)
		{
			if (c[i] != i - 1)
			{
				f = 0;
				break;
			}
		}
		if (f)
		{
			cnt++;
		}
	}
	cout << cnt;
	return 0;
}