a=input() b=input() cnt=0 for i in (a+b): if i=="o": cnt+=1 ans=max(ans,cnt) else:cnt=0 print(ans)