using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; namespace yukikoda { class Program { static void Main(string[] args) { string s = Console.ReadLine(); long ans = 0; for (int i = 0; i < s.Length; i++) { if (!s[i].Equals('c')) continue; long w = s.Substring(i).Where(x => x.Equals('w')).Count(); ans += w * (w - 1 ) / 2; } Console.WriteLine(ans); } } }