import java.util.Scanner; public class Main { public static void main (String[] args) { Scanner sc = new Scanner(System.in); System.out.println(solve(sc.next())); sc.close(); } public static long solve (String s) { int wcnt = 0; long sum = 0; int len = s.length(); for (int i = len - 1; i >= 0; i--) { if (s.charAt(i) == 'w') { wcnt++; continue; } if (s.charAt(i) == 'c') sum += wcnt * (wcnt - 1) / 2; } return sum; } }