import std.algorithm;
import std.bigint;
import std.concurrency;
import std.container;
import std.conv;
import std.functional;
import std.math;
import std.meta;
import std.random;
import std.range;
import std.stdio;
import std.string;
import std.traits;
import std.typecons;


auto solve(long M, long D) {
    int ans;
    foreach (m; 1 .. M + 1) foreach (d; 1 .. D + 1) {
        auto d1 = d % 10;
        auto d10 = d / 10;
        if (d1 >= 2 && d10 >= 2 && d1 * d10 == m)
            ans++;
    }
    return ans;
}


void main() {
    auto input = stdin.byLine.map!split.joiner;

    long M;
    M = input.front.to!long;
    input.popFront;

    long D;
    D = input.front.to!long;
    input.popFront;

    static if (is(ReturnType!solve == void))
        solve(M, D);
    else
        solve(M, D).writeln;
}
