#include using namespace std; #define FOR(i,l,r) for(int i = (l);i < (r);i++) #define ALL(x) (x).begin(),(x).end() template bool chmax(T& a,const T& b){return a < b ? (a = b,true) : false;} template bool chmin(T& a,const T& b){return b < a ? (a = b,true) : false;} typedef long long ll; int N; string S; int main() { cin >> S; N = S.size(); int c = count(ALL(S),'c'),w = count(ALL(S),'w'); cout << min(c - 1,w) << endl; return 0; }