#include "bits/stdc++.h" #define MOD 1000000007 #define INF 11234567890 #define in std::cin #define out std::cout #define rep(i,N) for(int i=0;i> S; for (int i = S.length() - 1; i >= 0; --i) { if (S[i] == 'w') { w1 = w2, w2 = i; } if (S[i] == 'c'&&w1 > 0) { ans = std::min(ans, w1 - i + 1); } } ans = ((ans == 100) ? (-1) : (ans)); out << ans << std::endl; return 0; }