using System; class CWW { static void Main(String[] args) { String S = Console.ReadLine(); uint[] wCount = new uint[S.Length+1]; for(int i=S.Length-1; i >= 0; i--) { if(S[i] == 'w') { wCount[i] = wCount[i+1]+1; } else { wCount[i] = wCount[i+1]; } } ulong cwwCount = 0; for(int i=0; i= 2) { cwwCount += wCount[i+1] * (wCount[i+1] - 1) / 2; } } } Console.WriteLine(cwwCount); } }