from collections import * from itertools import * from functools import * from heapq import * import sys,math # input = sys.stdin.readline C = list(input()) + list(input()) ans = 0 for g,r in groupby(C): if g=='o': ans = max(ans,len(list(r))) print(ans)