L=list(input()) T=list(input()) i=6 while i>=0 and L[i]=="o": i-=1 G=6-i i=0 while i<7 and T[i]=="o": i+=1 G+=i print (G)