main = do
 [a,b] <- map read . words <$> getLine
 print (solve a b)

f1 :: Integer -> Integer
f1 x = (div x 10)*(mod x 10)

solve :: Integer -> Integer -> Integer
solve m d
 | d < 22 = 0
 | (f1 d <= m && div d 10 >= 2 && mod d 10 >= 2) = 1 + solve m (d-1)
 | otherwise = solve m (d-1)