s=input()+input() ans=0;cur=0 for c in s: if c=='o': cur+=1 else: ans=max(ans,cur) cur=0 print(max(ans,cur))