#include #include #include #include #include #include #include #include #include #define rep(i,l,n) for(lint i=l;i vi; typedef vector vli; typedef vector vvi; typedef pair pii; int main(){ string s; cin>>s; int MIN=1000,f=0,tmp=0; rep(i,0,s.size()){ if(s[i]=='c'){ f=0; tmp=0; rep(j,i+1,s.size()){ if(s[j]=='w') f++; if(f==2){ tmp=j-i+1; MIN=min(MIN,tmp); break; } } } } o((MIN==1000?-1:MIN)); }