Week1 = str(input()) Week2 = str(input()) count1 = 0 count2 = 0 maxCount1 = 1 maxCount2 = 1 for i in range(len(Week1)): if(str(Week1) == "〇"): count1 += 1 else: if(maxCount1 < count1): maxCount1 = count1 count1 = 0 for i in range(len(Week2)): if(str(Week2) == "〇"): count2 += 1 else: if(maxCount2 < count2): maxCount2 = count2 count2 = 0 if(maxCount1 >= maxCount2): print(maxCount1) else: print(maxCount2)