import std.stdio, std.conv, std.string, std.range, std.math, std.bigint, std.algorithm, core.bitop; void main() { auto S = readln.strip; BigInt ans = 0; foreach (i, e; S[0 .. $ - 2]) { if (e != 'c') continue; BigInt wc = S[i .. $].count!`a=='w'`; ans += wc * (wc - 1) / 2; } ans.writeln; }