from itertools import groupby s = input() + input() res = 0 for k, v in groupby(s): if k == 'o': res = max(res, len(list(v))) print(res)