b=[input(),input()] ds = [] m = 0 for i in b: for d in i: if d == "o": m += 1 else: ds.append(m) m = 0 ds.append(m) print(max(ds))