Cfirst = input() Csecond = input() C = Cfirst + Csecond if "oooooooooooooo" in C : print(14) elif "ooooooooooooo" in C : print(13) elif "oooooooooooo" in C : print(12) elif "ooooooooooo" in C : print(11) elif "oooooooooo" in C : print(10) elif "ooooooooo" in C : print(9) elif "oooooooo" in C : print(8) elif "ooooooo" in C : print(7) elif "oooooo" in C : print(6) elif "ooooo" in C : print(5) elif "oooo" in C : print(4) elif "ooo" in C : print(3) elif "oo" in C : print(2) elif "o" in C : print(1) else : print(0)