#include char s[100001]; long long int w[100001], ans; int main(void) { scanf("%s", s); int i = 0, p = 0; while(s[i] != '\0') { if(s[i] == 'c') { p++; } if(s[i] == 'w') { w[p]++; } i++; } while(p > 0) { w[p] += w[p + 1]; ans += w[p] * (w[p] - 1) / 2; p--; } printf("%lld\n", ans); return 0; }