s = raw_input() + raw_input() m = 0 c = 0 for d in s: if d == 'o': c += 1 else: c = 0 m = max(m,c) print m