#include <stdio.h>

void main()
{
	int l, r;
	int i, j, mul, ans;
	FILE *input = fopen("product.in","rb");
	FILE *output = fopen("product.out","wb");

	fscanf(input, "%i",&l);
	fscanf(input, "%i",&r);
	
	ans = 0;
	for (i = l; i <= r; ++i) 
	{
	    j = i;
	    mul = 1;
	    while (j > 0) 
		{
			mul *= j % 10;
			j /= 10;
	    }
	    if (mul != 0 && i % mul == 0) 
		{
			++ans;
	    }
	}
	
	fprintf(output, "%i",ans);
	
	fclose(input);
	fclose(output);
}