#include using namespace std; int main() { int c=0,w=0; char a; bool cww=false; while (!cww) { a = getchar(); if (a < 97 || 122 < a) break; if (c) { if (w) { if (a == 'w') { cww = true; } } else if (a == 'w') { w++; } c++; } else if (a == 'c') { c++; } } if (cww) cout << c << endl; else cout << -1 << endl; return 0; }