m,d = gets.split.map(&:to_i)
dates = []
2.upto(9) do |i|
  2.upto(9) do |j|
    dates << [i*j,i*10+j]
  end
end
count = 0
dates.each do |date|
  count += 1 if (date[0] <= m) && (date[1] <= d)
end
puts count