#include #include #include #include #include #include #include #include #include #include #include #include using namespace std; typedef long long ll; #define MOD 1000000007 int main() { string s; cin >> s; int n = s.size(); for (int i = 0; i < n; ++i) { if (s[i] == 'c') { for (int j = i + 1; j < n; ++j) { if (s[j] == 'w') { for (int k = j + 1; k < n; ++k) { if (s[k] == 'w') { cout << k - i + 1 << endl; return 0; } } } } } } cout << -1 << endl; return 0; }