import std.stdio, std.conv, std.string, std.range, std.math, std.bigint, std.algorithm, core.bitop; void main() { auto S = readln.strip; long ans, wc; foreach_reverse (i, e; S) { if (e == 'w') wc++; if (e == 'c') ans += wc * (wc - 1) / 2; } ans.writeln; }