import java.io.*;
import java.util.*;

//Problem "Digit product"
//9th Internet Olympiad, basic level, season 2007-2008
//Problem Author: Fedor Tsarev, tsarev@rain.ifmo.ru
//Solution Author: Maxim Buzdalov, buzdalov@rain.ifmo.ru

public class product_mb {
    public static void main(String[] args) throws IOException {
	Scanner in = new Scanner(new File("product.in"));
	int l = in.nextInt();
	int r = in.nextInt();
	in.close();
	
	int ans = 0;
out:	for (int i = l; i <= r; ++i) {
	    int j = i;
	    int mul = 1;
	    while (j > 0) {
		mul *= j % 10;
		j /= 10;
	    }
	    if (mul != 0 && i % mul == 0) {
		++ans;
	    }
	}
	
	PrintWriter out = new PrintWriter("product.out");
	out.println(ans);
	out.close();
    }
}
