#include using namespace std; int main(){ ios::sync_with_stdio(false); cin.tie(0); string s; cin >> s; reverse(s.begin(), s.end()); int j = 0, w = 0; for(int i = 0; i < s.size(); i++) { if(s[i] == 'w') { if(w == 0) { j = i; } w++; } if(w == 2 && s[i] == 'c') { cout << i - j + 1 << endl; return 0; } } cout << -1 << endl; return 0; }