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(); long count = 0; int w = 0; for (long a = charArray.length - 1; a >= 0; a--){ if (charArray[(int) a] == 'w'){ w++; } if (charArray[(int) a] == 'c'){ count += w * (w - 1) / 2; } } System.out.println(count); } }