#include char in[101]; int count(int i){ int p = 1, a = 1; while(in[i] != '\0'){ a++; if(in[i]=='w') if(p==1) p++; else return a; i++; } return 101; } int main(){ int ans = 101, i = 0, c; scanf("%s", in); while(in[i] != '\0'){ if(in[i] == 'c'){ c = count(i + 1); if(c < ans) ans = c; } i++; } if(ans == 101) ans = -1; printf("%d\n", ans); return 0; }