solve :: Int -> Int -> Int
solve m d = length [ (x, y10, y1) | x <- [1 .. m], y10 <- [2 .. 9], y1 <- [2 .. 9], y10 * 10 + y1 <= d, x == y10 * y1]

main :: IO ()
main = do
  [m, d] <- fmap (\x -> read x :: Int) . words <$> getLine
  print $ solve m d
