#include <bits/stdc++.h>
using namespace std;

int main(){
	ios::sync_with_stdio(false);
	cin.tie(0);
	
	string s; cin >> s;
	long long ans = 0, num = 0;
	for(int i = 0; i < s.size(); i++){
		if(s[i] == 'w') num++;
	}
	for(int i = 0; i < s.size(); i++){
		if(s[i] == 'w') num--;
		if(s[i] == 'c' && num > 1) ans += num * (num - 1) / 2;
	}
	cout << ans << endl;
	return 0;	
}