#include int i, j, count, min = 101; char s[101]; int main(void) { scanf("%s", s); while(s[i] != '\0') { if(s[i] == 'c') { count = 0; j = i; while(s[j] != '\0') { if(s[j] == 'w') { count++; } if(count == 2) { min = ( (j - i + 1) < min ? (j - i + 1) : min ); break; } j++; } } i++; } printf("%d\n", (min == 101 ? -1 : min)); return 0; }