S1=list(input()) S2=list(input()) S3=S1+S2 x=[-1,14] N=[] for i in range(len(S3)): if (S3[i]=="x"): x.append(i) else: pass x=sorted(x) for i in range(len(x)-1): N.append(x[i+1]-x[i]) print(max(N)-1)