fun main(args: Array<String>) {
    val (M, D) = listOfInt()
    fun check(m: Int, dd: Int): Boolean {
        val (d10, d1) = listOf(dd / 10, dd % 10)
        if (d10 < 2 || d1 < 2) return false
        return m == d1 * d10
    }
    var ans = 0
    for (m in 1..M) {
        for (d in 1..D) {
            if (check(m, d)) {
                ans++
            }
        }
    }
    println(ans)
}
fun next() = readLine()!!
fun listOfString() = next().split(" ")
fun listOfInt(delta: Int = 0) = listOfString().map { Integer.parseInt(it) + delta }
