#include "bits/stdc++.h"

using namespace std;
typedef long long int ll;

int main(){
    //階乗を前計算
    string S;
    cin >> S;

    vector<ll > w;
     ll ans = 0;
    //後ろから選んだほうが早い..?
    ll count = 0;
    for(ll i = S.length(); i > 0; i--){
        if(S[i] == 'c'){
            ans += count * (count - 1) / 2;
            count = 0;
        }else if(S[i] == 'w'){
            count++;
        }
    }

    cout << ans << endl;

}