Problem:
 Score : 200 points    Problem Statement Today is August 24 , one of the five Product Days in a year.  A date m - d ( m is the month, d is the date) is called a Product Day when d is a two-digit number, and all of the following conditions are satisfied (here d_{10} is the tens digit of the day and d_1 is the ones digit of the day):   d_1 \geq 2  d_{10} \geq 2  d_1 \times d_{10} = m   Takahashi wants more Product Days, and he made a new calendar called Takahashi Calendar where a year consists of M month from Month 1 to Month M , and each month consists of D days from Day 1 to Day D .  In Takahashi Calendar, how many Product Days does a year have?      Constraints  All values in input are integers.  1 \leq M \leq 100  1 \leq D \leq 99         Input Input is given from Standard Input in the following format:  M  D       Output Print the number of Product Days in a year in Takahashi Calender.        Sample Input 1 15 40      Sample Output 1 10  There are 10 Product Days in a year, as follows ( m - d denotes Month m , Day d ):   4 - 22  6 - 23  6 - 32  8 - 24  9 - 33  10 - 25  12 - 26  12 - 34  14 - 27  15 - 35        Sample Input 2 12 31      Sample Output 2 5       Sample Input 3 1 1      Sample Output 3 0

Solution (Python):
m,d = map(int,input().split())
count = 0

for i in range(1,m+1):
    for j in range(10,d+1):
        a = list(str(j))
        if  int(a[0]) >= 2 and int(a[1]) >= 2 and int(a[0]) * int(a[1]) == i:
            count += 1
print(count)

Solution (Python):
month,day = map(int,input().split())

def takahashi(m,d):
    if d//10<2:
        return False
    if d%10<2:
        return False

    return (d//10) * (d%10) == m

cnt=0
for m in range(1,month+1):
    for d in range(1,day+1):
        if takahashi(m,d):
            cnt+=1
print(cnt)

Solution (Python):
m, d = map(int, input().split())
cnt = 0
for i in range(4, m+1):
    for j in range(1, d+1):
        if j >= 22:
            x = j // 10
            y = j % 10
            if x >= 2 and y >= 2 and (x * y) == i:
                cnt += 1
print(cnt)

Solution (Python):
M, D = map(int, input().split())
ans = 0
for i in range(1, D+1):
  x = i // 10
  y = i % 10
  if x > 1 and y > 1 and 1 <= x * y <= M:
    ans += 1
print(ans)

Solution (Python):
months, d = map(int, input().split())

ans_count = 0

for month in range(4, months + 1):
    for i in range(1, d + 1):
        if i <= 9:
            continue

        a, b = map(int, str(i))

        if a <= 1 or b <= 1:
            continue

        if a * b == month:
            ans_count += 1

print(ans_count)

Solution (Python):
months, d = map(int, input().split())

ans_count = 0

for month in range(4, months + 1):
    for i in range(1, d + 1):
        if i <= 9:
            continue

        a, b = map(int, str(i))

        if a >= 2 and b >= 2 and a * b == month:
            ans_count += 1

print(ans_count)

Solution (Python):

import sys
import math
import decimal
import itertools
from itertools import product
from functools import reduce
def input():
    return sys.stdin.readline()[:-1]
def gcd(*numbers):
    return reduce(math.gcd, numbers)
def lcm_base(x, y):
    return (x * y) // math.gcd(x, y)
def lcm(*numbers):
    return reduce(lcm_base, numbers, 1)
def sort_zip(a:list, b:list):
    z = zip(a, b)
    z = sorted(z)
    a, b = zip(*z)
    a = list(a)
    b = list(b)
    return a, b
def ceil(x):
    return math.ceil(x)
def floor(x):
    return math.floor(x)

def main():
    M, D = map(int, input().split())

    ans = 0
    for m in range(1, M + 1):
        for d in range(22, D + 1):
            if int(str(d)[1]) > 1 and int(str(d)[0]) * int(str(d)[1]) == m:
                ans += 1
    print(ans)




if __name__ == '__main__':
    main()

Solution (Python):
m,d = map(int,input().split())
c = 0
for i in range(22,d+1):
    if i//10*(i%10)<=m and i%10>=2:
        c+=1
print(c)

Solution (Python):
m,d = map(int,input().split())
c = 0
for i in range(22,d+1):
    if i//10*(i%10)<=m and i%10>=2:
        c+=1
print(c)

Solution (Python):
M,D = map(int,input().split())
ans = 0
for i in range(2,M+1):
    for j in range(22,D+1):
        if j % 10 == 1:
            continue
        ans += (i == (j//10) * (j%10))
print(ans)

Solution (Python):

M, D = [int(i) for i in input().split()]

seki_no_hi = 0

for m in range(1, M + 1):
    for d in range(10, D + 1):
        d1 = d % 10
        d10 = d // 10
        if d1 >= 2 and d10 >= 2 and d1 * d10 == m:
            seki_no_hi += 1

print(seki_no_hi)

Solution (Python):
import sys

readline = sys.stdin.readline
MOD = 10 ** 9 + 7
INF = float('INF')
sys.setrecursionlimit(10 ** 5)


def main():
    M, D = map(int, readline().split())
    ans = 0
    for m in range(1, M + 1):
        for d in range(10, D + 1):
            d_str = str(d)
            d_1 = int(d_str[1])
            d_10 = int(d_str[0])
            if d_1 >= 2 and d_10 >= 2:
                if d_1 * d_10 == m:
                    ans += 1

    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
def main():
  M,D=map(int,input().split())

  ans=0
  for i in range(22,D+1):
    if min(divmod(i,10)) in (0,1):
      continue
    q,r=divmod(i,10)
    if q*r <= M:
      ans += 1

  print(ans)
  
if __name__=="__main__":
  main()

Solution (Python):
m, d = map(int, input().split())

if d < 10:
    print(0)
    exit()

cnt = 0
for i in range(1,m+1):
    for j in range(10, d+1):
        t = str(j)
        if int(t[1]) >= 2 and int(t[0]) >= 2:
            if int(t[1]) * int(t[0]) == i:
                cnt += 1

print(cnt)

Solution (Python):
M,D=map(int,input().split())

ans=0
for i in range(22,D+1):
  if min(divmod(i,10)) in (0,1):
    continue
  q,r=divmod(i,10)
  if q*r <= M:
    ans += 1

print(ans)

Solution (Python):
m,d = map(int,input().split())
ans = 0
for i in range(2,m+1):
    for j in range(22,d+1):
        if j%10 == 1:
            continue
        ans += (i == (j//10)*(j%10))
print(ans)

Solution (Python):
def main():
    M, D = map(int, input().split())
    ans = 0

    for d in range(22, D + 1):
        d1 = d % 10
        d10 = d // 10

        if d1 < 2 or d10 < 2:
            continue

        if 4 <= d10 * d1 <= M:
            ans += 1

    print(ans)


if __name__ == "__main__":
    main()

Solution (Python):
M,D = map(int,input().split())
count = 0
for i in range(1,M+1):
  for j in range(1,D+1):
    if j >21:
      a = j//10
      b = j%10
      if i == int(a*b) and a>=2 and b>=2:
        
        count += 1
print(count)

Solution (Python):
m, d = input().split()

if len(d) == 1:
  print(0)
  exit()

result = 0

for month in range(int(m)):
  for day in range(10, int(d)):
    d_1, d_10 = map(int, str(day+1))
    if 2 <= d_1 and 2 <= d_10 and d_1 * d_10 == month+1:
      result += 1
    
print(result)

Solution (Python):
M,D=map(int,input().split())

ans=0
for m in range(1,M+1):
    for d in range(10,D+1):
        d1,d10=d%10,d//10
        if d1*d10==m and d1>1 and d10>1:
            ans+=1
print(ans)

Solution (Python):
M, D = map(int, input().split())
ans = 0
for m in range(4, M+1):
  for d in range(22, D+1):
    if d%10 < 2:
      continue
    if m == (d//10)*(d%10):
      ans += 1
print(ans)

Solution (Python):
M,D = map(int,input().split())
ans = 0
for m in range(1,M+1):
  for d in range(1,D+1):
    if (d%10)>=2 and (d//10)>=2 and (m==(d%10)*(d//10)):
      ans += 1
print(ans)

Solution (Python):
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(2, 10):
        if (i % j == 0) & (2 <= i // j <= 9) & (((i // j) * 10 + j) <= d):
            ans += 1
print(ans)

Solution (Python):
m, d = map(int, input().split())
count = 0
for i in range(21, d + 1):
    d1 = i % 10
    d10 = i // 10
    if d10 * d1 <= m and d10 >= 2 and d1 >= 2:
        count += 1
print(count)

Solution (Python):
m, d = map(int, input().split(' '))
ans = 0
for i in range(10, d + 1):
    s = str(i)
    d1 = int(s[1])
    d10 = int(s[0])
    if 2 <= d1 and 2 <= d10 and d1 * d10 <= m:
        ans += 1
print(ans)

Solution (Python):
m,d = map(int,input().split())

ans=0
for i in range(1,m+1):
    for j in range(1,d+1):
        if j >= 10:
            d10=int(str(j)[0])
            d1=int(str(j)[1])
            if d1 >= 2 and d10 >= 2 and d1*d10==i:
                ans+=1

print(ans)

Solution (Python):
M, D = map(int, input().split())
ans = 0
for i in range(1,M+1):
  for j in range(2,10):
    if i % j == 0 and 2 <= i//j < 10:
      if 10*j + i//j <= D:
        
        ans += 1
print(ans)

Solution (Python):
m,d = map(int,input().split())
ans = 0
for i in range(22,d+1):
    a = i%10
    b = i//10
    if a>= 2 and b >= 2 and 0 < a*b < m+1:
        ans += 1
        
print(ans)

Solution (Python):
m,d = map(int,input().split())
cnt = 0
for i in range(d+1):
  d10,d1 = i//10,i%10
  if d10 >= 2 and d1 >= 2 and d1 * d10 <= m:
    cnt += 1
print(cnt)

Solution (Python):
M,D = map(int,input().split())
ans = 0
for m in range(1,M+1):
  for d in range(1,D+1):
    if (d%10)>=2 and (d//10)>=2 and (m==(d%10)*(d//10)):
      ans += 1
print(ans)

Solution (Python):

m,d=map(int,input().split())
ans=0
for month in range(1,m+1):
    for day in range(1,d+1):
        d1=day%10
        d10=day//10
        if d1>=2 and d10>=2 and month==d1*d10:
            ans+=1
print(ans)

Solution (Python):
import sys
input = lambda : sys.stdin.readline().rstrip()
sys.setrecursionlimit(max(1000, 10**9))
write = lambda x: sys.stdout.write(x+"\n")


m,d = list(map(int, input().split()))
ans = 0
for i in range(1, m+1):
    for j in range(1, d+1):
        if j<10:
            continue
        d1 = int(str(j)[0])
        d2 = int(str(j)[1])
        if d1*d2==i and d1>=2 and d2>=2:
            ans += 1
print(ans)

Solution (Python):
import sys
input=sys.stdin.readline
sys.setrecursionlimit(10 ** 8)
from itertools import accumulate
from itertools import permutations
from itertools import combinations
from collections import defaultdict
from collections import Counter
import fractions
import math
from collections import deque
from bisect import bisect_left
from bisect import bisect_right
from bisect import insort_left
import itertools
from heapq import heapify
from heapq import heappop
from heapq import heappush
import heapq
from copy import deepcopy
from decimal import Decimal
alf = list("abcdefghijklmnopqrstuvwxyz")
ALF = list("ABCDEFGHIJKLMNOPQRSTUVWXYZ")

INF = float("inf")


M,D = map(int,input().split())
ans = 0
for i in range(1,M+1):
    for j in range(2,1+D//10):
        for k in range(2,10):
            if j*10+k > D:
                break
            if i == j*k:
                ans += 1
print(ans)

Solution (Python):
m,d = map(int,input().split())
ans = 0
for i in range(1,d+1):
  if i < 22:
    continue
  else:
    if i%10 == 0:
      continue
    else:
      if i%10 == 0 or i%10 == 1:
        continue
      else:
        if (i//10)*(i%10) <= m:
          ans += 1
print(ans)

Solution (Python):
m,d=map(int,input().split())
l=list(range(1,m+1))
ans=0
for i in range(1,d+1):
    d_1=i%10
    d_10=(i-d_1)//10
    if d_1*d_10  in l and d_1!=1 and d_10!=1:
        ans+=1
print(ans)

Solution (Python):
import sys, math
from functools import lru_cache
sys.setrecursionlimit(500000)
MOD = 10**9+7

def input():
    return sys.stdin.readline()[:-1]

def mi():
    return map(int, input().split())

def ii():
    return int(input())

def i2(n):
    tmp = [list(mi()) for i in range(n)]
    return [list(i) for i in zip(*tmp)]

def main():
    M, D = mi()
    cnt = 0

    for m in range(1, M+1):
        for d in range(1, D+1):
            if d > 9:
                d1 = int(str(d)[1])
                d10 = int(str(d)[0])

                if d1 >= 2 and d10 >= 2 and d1*d10 == m:
                    cnt += 1

    print(cnt)

if __name__ == '__main__':
    main()

Solution (Python):
import sys
import itertools

import time
import math
import heapq
from collections import defaultdict
from collections import Counter
sys.setrecursionlimit(10 ** 7)
 
INF = 10 ** 18
MOD = 10 ** 9 + 7
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines



M, D = map(int, input().split())

ans = 0
for i in range(1, M + 1):
    for j in range(1, D + 1):
        d1 = j // 10
        d2 = j % 10
        if d1 < 2 or d2 < 2:
            continue
        if d1 * d2 == i:
            ans += 1
print(ans)

Solution (Python):
M,D=map(int,input().split())
a=0
for i in range(1,M+1):
    for j in range(11,D+1):
        if i==((j//10)*(j%10)) and j//10>=2 and j%10>=2:
            a+=1
print(a)

Solution (Python):
m,d=map(int,input().split())
c=0
for x in range(d+1):
    d10,d1=x//10,x%10
    if d10>=2 and d1>=2 and d10*d1<=m:c+=1
print(c)

Solution (Python):
m,d=map(int,input().split())
ans=0
for i in range(1,m+1):
    for j in range(22,d+1):
        if j%10>=2 and (j%10)*(j//10)==i:
            ans+=1
print(ans)

Solution (Python):
m,d=map(int,input().split())
ans=0
for i in range(1,m+1):
  for j in range(1,d+1):
    if j//10>=2 and j%10>=2 and (j//10)*(j%10)==i:
      ans+=1
      
print(ans)

Solution (Python):
M,D=map(int,input().split())

answer=0
for m in range(1,M+1):
  for d in range(1,D+1):
    d10=d//10
    d1=d%10    
    if d1>=2 and d10>=2 and d1*d10==m:
      answer+=1
      
print(answer)

Solution (Python):
import sys

read = sys.stdin.read
readline = sys.stdin.buffer.readline
sys.setrecursionlimit(10 ** 8)
INF = float('inf')
MOD = 10 ** 9 + 7


def main():
    M, D = map(int, readline().split())
    ans = 0
    for m in range(1,M+1):
        for d in range(1,D+1):
            d = str(d)
            if len(d)==1:
                d = '0'+d
            if int(d[0])>=2 and int(d[1])>=2 and int(d[0])*int(d[1])==m:
                ans += 1
    print(ans)

if __name__ == '__main__':
    main()

Solution (Python):
from sys import stdin
nii=lambda:map(int,stdin.readline().split())
lnii=lambda:list(map(int,stdin.readline().split()))

m,d=nii()

ans=0
for i in range(1,m+1):
  for j in range(1,d+1):
    if j>=10:
      d1=j%10
      j//=10
      d2=j
      if d1>=2 and d2>=2 and d1*d2==i:
        ans+=1

print(ans)

Solution (Python):



from fractions import gcd
from itertools import combinations,permutations,accumulate 

from collections import deque,defaultdict,Counter
import decimal
import re












import sys
sys.setrecursionlimit(10000000)
mod = 10**9 + 7

def readInts():
  return list(map(int,input().split()))
def I():
  return int(input())
m, d = readInts()
cnt = 0
for i in range(1,m+1):
    for j in range(20,d+1):
        
        if int(str(j)[0]) >= 2 and int(str(j)[1]) >= 2 and (int(str(j)[0]) * int(str(j)[1])) == i:
            
            cnt += 1
print(cnt)

Solution (Python):
def solve():
  M, D = map(int, input().split())
  ans = 0
  for i in range(12,D+1):
    a,b = int(str(i)[0]),int(str(i)[1])
    if a>1 and b>1:
      if a*b<=M:
        ans += 1
  return ans
print(solve())

Solution (Python):
import sys
def input(): return sys.stdin.readline().strip()
def mapint(): return map(int, input().split())
sys.setrecursionlimit(10**9)

M, D = mapint()

ans = 0
for m in range(1, M+1):
    for d in range(1, D+1):
        d = str(d)
        if len(d)!=2:
            continue
        d1 = int(d[1])
        d10 = int(d[0])
        if d1<2 or d10<2: continue
        if m==d1*d10:
            ans += 1

print(ans)

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

m,d = lr()
ans = 0
for i in range(4,m+1):
    for j in range(22,d+1):
        d1 = j%10
        d10 = j//10
        if i == d1*d10 and d1>=2 and d10>=2:
            ans+=1
print(ans)

Solution (Python):
M,D = map(int,input().split())
cnt = 0
for m in range(4,M+1):
    for d in range(1,D+1):
        if d>=20:
            d = str(d)
            if int(d[1])>=2:
                if m==int(d[0])*int(d[1]):
                    cnt += 1
print(cnt)

Solution (Python):
m,d=map(int,input().split())
ans=0
for i in range(2,m+1):
  for j in range(22,d+1):
    s=str(j)
    if int(s[1])<2:
      continue
    if i==int(s[0])*int(s[1]):
      ans+=1
print(ans)

Solution (Python):
M, D = map(int, input().split())

ans = 0

for m in range(1, M+1):
    for d in range(1, D+1):
        d1 = d % 10
        d2 = d // 10
        if d1 >= 2 and d2 >= 2:
            if m == d1*d2:
                ans += 1

print(ans)

Solution (Python):
M,D = map(int,input().split())

ans = 0
for m in range(1,M+1):
    for d in range(10,D+1):
        a,b = map(int,str(d))
        if a>=2 and b>=2 and a*b == m:
            ans += 1
print(ans)

Solution (Python):
M, D = [int(i) for i in input().split()]
cnt = 0
for m in range(1, M + 1):
  for d in range(1, D + 1):
    d1 = d // 10
    d2 = d % 10
    if d1 < 2 or d2 < 2:
      continue
    if d1 * d2 == m:
      cnt += 1
print(cnt)

Solution (Python):
[m,d] = [int(i) for i in input().split()]
ans = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        da = str(j)
        if j < 10:
            d10 = 0
            d1 = da
        else:
            d10 = da[0]
            d1 = da[1]
        if int(d10) >= 2 and int(d1) >= 2 and int(d10) * int(d1) == i:
            ans += 1
print(ans)

Solution (Python):
M,D=map(int,input().split())
ans=0
for i in range(11,D+1):
  a,b=0,0
  if i%10>=2:
    a=i%10
  if i//10>=2:
    b=i//10
  if 4<=a*b<=M:
    ans+=1
print(ans)

Solution (Python):
import math

def resolve():
    M,D=map(int,input().split())

    cnt=0
    for m in range(1,M+1):
        for d in range(1,D+1):
            if(d//10 < 2 or d%10 <2):
                continue
            if((d%10) * (d//10) == m):
                cnt+=1

    print(cnt)


resolve()

Solution (Python):
import math
import sys
import collections
import bisect
readline = sys.stdin.readline


def main():
    m, d = map(int, readline().rstrip().split())
    if d < 10:
        print(0)
        return

    cnt = 0
    for k in range(1, m + 1):
        for i in range(10, d + 1):
            d1, d10 = int(str(i)[1]), int(str(i)[0])
            if d1 * d10 == k and d1 > 1 and d10 > 1:
                cnt += 1
    print(cnt)


if __name__ == '__main__':
    main()

Solution (Python):
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(10, d + 1):  
        d1 = int(str(j)[1])
        d10 = int(str(j)[0])
        if d1 >= 2 and d10 >= 2 and d1 * d10 == i:
            ans += 1
print(ans)

Solution (Python):
m, d = map(int, input().split())
ans = 0
if d <= 21:
  ans = 0
else:
  for i in range(m):
    i += 1
    for j in range(21, d):
      j += 1
      d1 = int(str(j)[0])
      d2 = int(str(j)[1])
      if d1 * d2 == i and d1 >= 2 and d2 >= 2:
        ans += 1
print(ans)

Solution (Python):
m,d = map(int,input().split())
cnt = 0
if d <= 19:
    print(0)
    exit()
for i in range(1,m+1):
    for j in range(20,d+1):
        if (j%10)*(j//10) == i and j%10 != 1:
            
            cnt += 1
print(cnt)

Solution (Python):
M, D = map(int,input().split())

ans = 0
for i in range(1, M+1):
    for j in range(11, D+1):
        j = str(j)
        k = int(j[0])
        l = int(j[1])
        if k >= 2 and l >= 2 and i == k * l:
            ans += 1

print(ans)

Solution (Python):
m, d = map(int, input().split())
ans = 0

for i in range(4, m + 1):
    for j in range(22, d + 1):
        d10 = j//10
        d1 = j%10
        if d10 >= 2 and d1 >= 2:
            if d10*d1 == i:
                ans += 1
print(ans)

Solution (Python):





import math
import fractions
import sys
import bisect
import heapq  
import collections
from collections import Counter
from collections import deque
import pprint
import itertools

sr = lambda: input()
ir = lambda: int(sr())
lr = lambda: list(map(int, sr().split()))

"""nを素因数分解"""
"""2以上の整数n => [[素因数, 指数], ...]の2次元リスト"""


def factorization(n):
    arr = []
    temp = n
    if n == 1:
        return arr

    for i in range(2, int(-(-n ** 0.5 // 1)) + 1):
        if temp % i == 0:
            cnt = 0
            while temp % i == 0:
                cnt += 1
                temp //= i
            arr.append([i, cnt])

    if temp != 1:
        arr.append([temp, 1])

    if arr == []:
        arr.append([n, 1])

    return arr



def power(a, n, mod):
    x = 1
    while n:
        if n & 1:
            x *= a % mod
        n >>= 1
        a *= a % mod
    return x % mod



def kaijo(n, l, mod):
    if n == 0:
        return 1
    a = n
    tmp = n - 1
    while (tmp >= l):
        a = a * tmp % mod
        tmp -= 1
    return a


class UnionFind():
    def __init__(self, n):
        self.n = n
        self.parents = [-1] * n

    def find(self, x):
        if self.parents[x] < 0:
            return x
        else:
            self.parents[x] = self.find(self.parents[x])
            return self.parents[x]

    def union(self, x, y):
        x = self.find(x)
        y = self.find(y)

        if x == y:
            return

        if self.parents[x] > self.parents[y]:
            x, y = y, x

        self.parents[x] += self.parents[y]
        self.parents[y] = x

    def size(self, x):
        return -self.parents[self.find(x)]

    def same(self, x, y):
        return self.find(x) == self.find(y)

    def members(self, x):
        root = self.find(x)
        return [i for i in range(self.n) if self.find(i) == root]

    def roots(self):
        return [i for i, x in enumerate(self.parents) if x < 0]

    def group_count(self):
        return len(self.roots())

    def all_group_members(self):
        return {r: self.members(r) for r in self.roots()}

    def __str__(self):
        return '\n'.join('{}: {}'.format(r, self.members(r)) for r in self.roots())


def make_divisors(n):
    divisors = []
    for i in range(1, int(n**0.5)+1):
        if n % i == 0:
            divisors.append(i)
            if i != n // i:
                divisors.append(n//i)

    divisors.sort()
    return divisors


inf = 10 ** 18
mod = 10 ** 9 + 7

m,d = lr()
ans = 0
for i in range(1,m+1):
    for j in range(10,d+1):
        if i == (j%10)*(j//10) and j%10>=2 and j//10>=2:
            ans+=1
print(ans)

Solution (Python):
MD = [int(i) for i in input().split(' ')]
M = [int(i)+1 for i in range(MD[0])]
D = [int(i)+1 for i in range(MD[1])]

count = 0
for d in D:
    if d // 10 >= 2 and d % 10 >= 2:
        d2 = d // 10
        d1 = d % 10
        if d1*d2 in M:
            count+=1

print(count)

Solution (Python):
m, d = map(int, input().split())
ans = 0

for i in range(1, m+1):
    for j in range(1, d+1):
        if j%10 > 1 and j//10 > 1 and i == (j%10)*(j//10):
            ans += 1
print(ans)

Solution (Python):
M, D = [int(_) for _ in input().split()]
ans = 0
for m in range(1, M+1):
  for d in range(1, D+1):
    d0 = d%10
    d10 = (d - d%10)//10
    if d0 > 1 and d10 > 1 and d0 * d10 == m: ans += 1
print(ans)

Solution (Python):
M,D=map(int,input().split())

ans=0
i=1
while i<=M:
    j=22
    while j<=D:
        if j%10>=2 and (j//10)*(j%10)==i:
            ans+=1
        j+=1
    i+=1
print(ans)

Solution (Python):
m,d = map(int,input().split())
ans = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        r = list(str(j))
        if len(r) >= 2:
            if int(r[0])*int(r[1]) == i and int(r[0]) >= 2 and int(r[1]) >= 2:
                ans += 1
                
print(ans)

Solution (Python):
import sys
import time
import math
def inpl():
    return list(map(int, input().split()))
st = time.perf_counter()


M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
	for d in range(D+1):
		if d < 10:
			continue
		if d//10 >= 2 and d%10 >= 2 and (d//10)*(d%10) == m:
			ans += 1
print(ans)


ed = time.perf_counter()
print('time:', ed-st, file=sys.stderr)

Solution (Python):
m,d= map(int, input().split())

ans=0
for mon in range(1,m+1):
    for day in range(1,d+1):
        if day<22:
            continue
        d1,d2=str(day)
        d1,d2=int(d1),int(d2)
        if d1<2 or d2<2:
            continue
        if d1*d2==mon:
            ans+=1

print(ans)

Solution (Python):
m, d = map(int, input().split())
if d < 22:
  print(0)
  exit()
cnt = 0
for i in range(1, m + 1):
  for j in range(22, d + 1):
    ten = int(str(j)[0])
    one = int(str(j)[1])
    if ten >= 2 and one >= 2 and ten * one == i:
      cnt += 1
print(cnt)

Solution (Python):
m, d = map(int, input().split())
ans = 0
for i in range(1, m + 1):
    for j in range(1, d + 1):
        x, y = j % 10, j // 10
        if x >= 2 and y >= 2 and x * y == i:
            ans += 1
print(ans)

Solution (Python):
M, D = map(int, input().split())
ans = 0
for m in range(1, M+1):
    for d in range(10, D+1):
        d = str(d)
        d10, d1 = map(int, (d[1], d[0]))
        if d10 >= 2 and d1 >= 2 and d10*d1 == m:
            ans += 1
print(ans)

Solution (Python):
M, D = map(int, input().split())
if D < 10:
    print(0)
    exit()
ans = 0
for m in range(1, M+1):
    for d in range(10, D+1):
        d10, d1 = map(int, (str(d)[1], str(d)[0]))
        if d10 >= 2 and d1 >= 2 and d10*d1 == m:
            ans += 1

print(ans)

Solution (Python):
m,d = map(int,input().split())
k = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        x = j // 10
        if x < 2:
            continue
        y = j % 10
        if y < 2:
            continue
        if x * y == i:
            k += 1

print(k)

Solution (Python):
m,n = map(int,input().split())

cnt = 0
for i in range(1,m+1):
    for j in range(10,n+1):
        num = 1
        d = str(j)
        l = len(d)
        
        for k in range(l):
            if int(d[k]) < 2:
                num =1
                break
            else:
                num *=int(d[k])
        if num == i and num !=1:
            cnt +=1
print(cnt)

Solution (Python):
m,d = map(int,input().split())


cnt = 0
for i in range(1,m+1):
    for j in range(1,d+1):
        
        num = 1
        d2 = (j-j%10)//10
        d1 = j%10
        if d2 >=2 and d1 >=2:
            num =d1*d2
            
        
            if num == i:
                cnt +=1
print(cnt)

Solution (Python):
M, D = map(int, input().split())
ans = 0
for i in range(1, M+1):
    for j in range(1, D+1):
        if j % 10 < 2 or j // 10 < 2:
            continue
        else:
            j_str = str(j)
            mul = int(j_str[0]) * int(j_str[1])
            if mul == i:
                ans += 1
print(ans)

Solution (Python):
m,d=map(int,input().split());ans=0
for i in range(1,m+1):
  for j in range(10,d+1):
    d1=int(str(j)[0]);d10=int(str(j)[1])
    if len(str(j))==2 and d1>=2 and d10>=2 and d1*d10==i:
      ans+=1
print(ans)

Solution (Python):
m,d=map(int,input().split())
ans=0
for i in range(1,m+1):
  for j in range(22,d+1):
    if j%10>=2 and (j//10)*(j%10)==i:
      ans=ans+1
print(ans)

Solution (Python):
M,D = map(int,input().split())
res = 0
for i in range(1,M+1):
    for j in range(1,D+1):
        d1 = j % 10
        d10 = j //10
        if 2 <= d1 and 2 <= d10 and d1*d10 == i:
            res += 1
print(res)

Solution (Python):
m, d = map(int, input().split())
count = 0

for i in range(2, m+1):
    for j in range(20, d+1):
        dt, do = divmod(j, 10)
        if 1 < do and dt * do == i:
            count += 1

print(count)

Solution (Python):
m, d = map(int, input().split())
res = 0
for i in range(1, m + 1):
    for j in range(1, d + 1):
        if j >= 10 and j % 10 >= 2 and j // 10 >= 2 and (j // 10) * (j % 10) == i:
            res += 1

print(res)

Solution (Python):

M,D = map(int,input().split())
cnt = 0
for j in range(1,M+1):
    for i in range(11,D+1):
        a,b = list(str(i))
        a = int(a)
        b = int(b)
        if a*b==j and a>1 and b>1:
            cnt+=1
print(cnt)

Solution (Python):
M, D = map(int, input().split())

ans = 0
for m in range(1, M+1):
    for d in range(22, D+1):
        d10 = d // 10 % 10
        d1 = d % 10
        if d1 >= 2 and d10 >= 2:
            if m == d1 * d10:
                ans += 1

print(ans)

Solution (Python):
m,d=map(int,input().split())
c=0
for i in range(1,m+1):
	for j in range(1,d+1):
		if j>=10:
			d10=int(str(j)[0])
			d1=int(str(j)[1])
			if d10>1 and d1>1:
				if i==d10*d1:
					
					c+=1
print(c)

Solution (Python):
def resolve():
    A, B = map(int, input().split())
    ans = 0
    for i in range(1, A+1):
        for j in range(10, B+1):
            if str(j)[0] != "1" and str(j)[1] != "1":
                if int(str(j)[0])*int(str(j)[1]) == i:
                    ans += 1
    print(ans)
resolve()

Solution (Python):
M,D = map(int, input().split())

ans = 0

for i in range(1,M+1):
    for j in range(D+1):
        d1,d10 = j%10, j//10
        if d1*d10 == i and d1>= 2 and d10 >= 2:
            ans +=1

print(ans)

Solution (Python):
d = input().split()
ans = []
cnt = 0
for day in range(int(d[1])+1):
    if (day >= 22):
        if (int(str(day)[0]) >=2 and int(str(day)[1]) >=2 ):
            ans.append(int(str(day)[0]) * int(str(day)[1]))
for date in range(2, int(d[0])+1):
    cnt = cnt + ans.count(date)
print(cnt)

Solution (Python):
m,d = list(map(int, input().split())) 
cnt = 0
for  j in range(1,m+1):
    for i in range(1, d+1, 1):
        d1 = i % 10
        d2 = int(i / 10)
        if((d1 >= 2) & (d2 >= 2) & (d1 * d2 == j) ):
            cnt+=1
print(cnt)

Solution (Python):
m, d = map(int, input().split())

ans = 0


for i in range(1,m+1):
    for j in range(1, d+1):
        if len(str(j)) == 1:
            continue
        d1 = j%10
        d2 = j//10
        if d1 >= 2 and d2 >= 2 and d1*d2==i:
            ans += 1

print(ans)