#include int main(void) { int i, j, m = 100, c; char s[101] = {}; scanf("%s", &s); for( i = 0; s[i] != NULL; i++) { if(s[i] == 'c') { c = 0; for( j = i+1; s[j] != NULL && c != 2; j++) { if( s[j] == 'w' ) c++; if( c == 2 && j-i+1 < m) m = j-i+1; } } } if( m == 100 ) { printf("-1\n"); return 0; } printf("%d\n", m); return 0; }