using System; namespace No346 { class Program { static void Main(string[] args) { long num = 0; long count = 0; string text = Console.ReadLine(); for (int i = text.Length - 1; i >= 0; i--) { if (text[i] == 'w') count++; if (text[i] == 'c') num += count * (count - 1) / 2; } Console.WriteLine(num); } } }