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