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