# No.203 ゴールデン・ウィーク(1) s = input() + input() holidays = s.split('x') num_holidays = [len(i) for i in holidays] print(max(num_holidays))