using System; class CWW { static void Main(String[] args) { String S = Console.ReadLine(); int[] wCount = new int[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]; } } long cwwCount = 0; for(int i=0; i= 2) { cwwCount += wCount[i+1] * (wCount[i+1] - 1) / 2; } } } Console.WriteLine(cwwCount); } }