c=list(input())+list(input()) ans=[] ct=0 for i in range(len(c)): if c[i]=='o': ct+=1 else: ans.append(ct) ct=0 ans.append(ct) print(max(ans))