using System; namespace No346 { class Program { static void Main(string[] args) { int num = 0; string word = "cww"; string text = Console.ReadLine(); for (int i = 0; i < text.Length; i++) { if (text[i] == word[0]) { int count = 0; for (int j = i + 1; j < text.Length; j++) { if (text[j] == word[1]) count++; } if (count > 1) num += Factorial(count) / (2 * Factorial(count - 2)); } } Console.WriteLine(num); } static int Factorial(int num) { int result = 1; for (int i = 1; i <= num; i++) result *= i; return result; } } }