defgreed(x,y):
dict = {}
for i in x:
dict[i]=dict.get(i,0)+1#{'d': 4, 'a': 3, 'w': 2}
匹配次数=0for z in y:
if z in x anddict[z] >0:#匹配成功
匹配次数 +=1dict[z] -=1#if dict[z] == 0:# del dict[z] #如果dict[i] =0 即失去匹配次数 可以移除也可以不移除 return 匹配次数
x=input()
y=input()
print(greed(x,y))