#include using namespace std; int main() { string s; cin >> s; int ans = 0; int w = 0; bool f = false; int l = s.size(); for(int i = 0; i < l; i++) { if(s[i] == 'c') { if(f) { ans = 0; w = 0; } f = true; } if(f){ ans++; if(s[i] == 'w') { w++; } if(w == 2)break; } } if(ans == 0)cout << -1; else cout << ans; }