m,d = gets.chomp.split.map(&:to_i)
result = 0

if m >= 4 && d >= 22
  for month in 4..m do
    for day in 22..d do
      d_1 = day % 10
      d_10 = day.to_i / 10

      result += 1 if (d_1 * d_10) == month
    end
  end
end

p result