using System; using System.Collections; using System.Collections.Generic; using System.Collections.Specialized; using System.Text; using System.Text.RegularExpressions; using System.Linq; class Magatro { static void Main() { string S = Console.ReadLine(); List cnt = new List(); for (int i = 0; i < S.Length; i++) { if (S[i] == 'c') cnt.Add(0); else if (S[i] == 'w') cnt = cnt.Select(s => s+=1).ToList(); } long ans = cnt.Select(s => Combination(s)).Sum(); Console.WriteLine(ans); } static long Combination(int n) { return n * (n - 1) / 2; } }