program takahashi_calendar
  implicit none
  integer :: m, d, d1, d10, i, j, ans = 0
  read(*,*) m, d
  do i = 1, m
    do j = 22, d
      d1 = mod(j,10)
      if (d1 < 2) cycle
      d10 = j/10
      if (i == d1*d10) ans = ans+1
    end do
  end do
  write(*,'(i0)') ans
end program takahashi_calendar