class Solution:
def countDigits(self, num: int) -> int:
l1=[] #list of single digit factors
k=min(num+1, 10)
for i in range(1,k): #range(num), range(num+1), range(1, num+1)
if num%i==0:
l1.append(i)
n=str(num)
l2=[] #list of numbers in num
for i in range(len(n)):
m=int(n[i])
l2.append(m)
c=0
for i in l2:
if i in l1:
c=c+1
return c