s1 = input() s2 = input() res = 0 cnt = 0 c = '{0}{1}x'.format(s1, s2) for ci in c: if ci == 'o': cnt += 1 else: res = max(cnt, res) cnt = 0 print(res)