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(); int ans = 0; for (int i = 0; i < s.Length; i++) { if (!s[i].Equals('c')) continue; int w = s.Substring(i).Where(x => x.Equals('w')).Count(); ans += calc(w) / (2 * calc(w - 2)); } Console.WriteLine("{0}", ans); } static int calc(int a) { int r = 1; for (int i = 1; i <= a; i++) { r *= i; } return r; } } }