#define _USE_MATH_DEFINES //M_PI(π),M_SQRT2(√2) #include //std::cout, std::cin #include //std::string #include //std::vector #include //std::valarray #include //std::sort #include //localtime_s #include //abs #include //abs,std::pow,sqrt,sin,cos,round,floor,ceil #include //std::ifstream #include //std::setprecision,std::setw,std::setfill #include //std::random(C++11) #include //std::accumulate int main(void) { //test用 //std::ifstream in("test.txt"); //std::cin.rdbuf(in.rdbuf()); //const unsigned int MODULO = 1000000007; //MODULO 10^9+7用 std::string str, C; std::cin >> str; C += str; std::cin >> str; C += str; int max = 0, temp = 0; bool flg = false; for (int i = 0; i < C.length(); i++) { if (C[i] == 'x') { if (flg) { flg = false; if (temp >= max) { max = temp; } temp = 0; } } else { flg = true; temp++; } } if (temp != 0) { if (temp >= max) { max = temp; } } std::cout << max << std::endl; }