let () =
  let check m d1 d10 = d1 >= 2 && d10 >= 2 && d1 * d10 = m in
  Scanf.scanf "%d %d\n" @@ fun m d ->
  let ans = ref 0 in
  for i = 1 to m do
    for j = 10 to d do
      if check i (j mod 10) (j / 10) then ans := !ans + 1
    done;
  done;
  Printf.printf "%d\n" !ans