input = gets.split("\s")
m = input[0].to_i
d = input[1].to_i
result = 0

m.times do |month|
  d.times do |day|
    day1 = (day+1) % 10
    day10 = (day+1) / 10
    if(day1 > 1 && day10 > 1)
      if(day1 * day10 == month+1)
        result += 1
      end
    end
  end
end

puts result
