#include using namespace std; #ifdef LOCAL #include "settings/debug.cpp" #define _GLIBCXX_DEBUG #else #define Debug(...) void(0) #endif #define rep(i, n) for (int i = 0; i < (n); ++i) using ll = long long; using ull = unsigned long long; int main() { string x, y; cin >> x >> y; string z = x + y; for (int ans = z.size(); ans >= 0; ans--) { rep(i, z.size() - ans + 1) { string s = z.substr(i, ans); string t = ""; rep(_, ans) t += 'o'; if (s == t) { cout << ans << endl; return 0; } } } return 0; }