#include #include int main() { char s[102]; scanf("%s", s); int i, j, k, n = strlen(s); int ans = 4649; for (i = 0; i < n - 2; i++) for (j = i + 1; j < n - 1; j++) for (k = j + 1; k < n; k++) if (s[i] == 'c' && s[j] == 'w' && s[k] == 'w') if (ans > k - i + 1) ans = k - i + 1; if (ans > 100) ans = -1; printf("%d\n", ans); return 0; }