import java.util.*; public class Exercise30{ public static void main (String[] args){ Scanner sc = new Scanner(System.in); String str = sc.next(); char[] charArray = str.toCharArray(); int count = 0; for (int a = 0; a < charArray.length; a++){ if (charArray[a] == 'c'){ for (int b = a + 1; b < charArray.length; b++){ if (charArray[b] == 'w'){ for (int c = b + 1; c < charArray.length; c++){ if (charArray[c] == 'w'){ count++; } } } } } } System.out.println(count); } }