#include using namespace std; #define rep(i,a,b) for(int i=a;i> s; int ans = 1000; rep(i, 0, s.length()) rep(j, i + 1, s.length()) rep(k, j + 1, s.length()) { if (s[i] == 'c' && (s[j] == 'w' && s[k] == 'w')) { ans = min(ans, k - i + 1); } } if (ans == 1000) ans = -1; cout << ans << endl; }