# coding:utf-8 c0 = input() c1 = input() c = c0 + c1 count = 0 ans = [] for i in list(c): if i == 'o': count += 1 else: ans.append(count) count = 0 # print(i) ans.append(count) print(max(ans))