Week1 = str(input()) Week2 = str(input()) CircleNumOfWeek1 = Week1.count("〇") CircleNumOfWeek2 = Week2.count("〇") if(CircleNumOfWeek1 >= CircleNumOfWeek2): print(CircleNumOfWeek1) elif(CircleNumOfWeek2 >= CircleNumOfWeek1): print(CircleNumOfWeek2) else: print(CircleNumOfWeek1)