using System; using System.Collections.Generic; using System.Linq; namespace yukicoder { public class Program { public static void Main() { var c = Console.ReadLine(); long sum = 0; long w = 0; for (var i = c.Length - 1; i >= 0; i--) { if (c[i] == 'w') { w++; } else if (c[i] == 'c') { sum += w * (w - 1) / 2; } } Console.WriteLine(sum); } } }