#include <bits/stdc++.h>
using namespace std;
int s[10], g[10] = {0, 0, 1, 2, 3, 4, 5, 6, 7};
bool y[10];
int main()
{
	int a, b, cnt = 0;
	cin >> a >> b;
	for (int i = a; i <= b; i++)
	{
		int a = i, x = 0; 
		while (a > 0)
		{
			s[++x] = a % 10;
			a /= 10;
		}
		for (int j = 1; j <= x; j++)
		{
			for (int k = 1; k <= x; k++)
			{
				if (s[j] == g[k]) y[k] == 1;
			}
		}
		bool hg = 1;
		for (int j = 1; j <= x; j++)
		{
			if (y[x] == 0) hg = 0;
		}
		if (hg == 1) cnt++;
	}
	cout << cnt;

	return 0;
}