#include int main() { char s[101]; std::cin >> s; int ret = 999; int count; int w; for(int i = 0; s[i]; i++) { if(s[i] == 'c') { count = 1; w = 0; for(int j = i + 1; s[j]; j++) { count++; if(s[j] == 'w') w++; if(w == 2) { ret = (ret < count)? ret:count; break; } } } } ret = (ret == 999)? -1:ret; std::cout << ret << std::endl; return 0; }