A=input()+input() ANS=0 now=0 for s in A: if s=="o": now+=1 else: now=0 ANS=max(ANS,now) print(ANS)