# -*- coding: utf-8 -*- A = [""] * 2 A[0] = raw_input() A[1] = raw_input() # 番兵 A[1] += "_" current = "x" count = 0 mx = 0 for c in (A[0] + A[1]): if c == "o": count += 1 else: count = 0 current = c mx = max(mx, count) print mx