import java.util.*; import java.math.*; import java.text.*; public class Main { private static Scanner sc = new Scanner(System.in); public static void main(String[] args) throws Exception { String s = sc.next(); int l = s.length(); int[] ary = new int[l]; int cnt = 0; for (int i = l-1;i >= 0;i--) { if (s.charAt(i) == 'w') cnt++; ary[i] = cnt; } long ret = 0; for (int i = 0;i < l;i++) { if (s.charAt(i) == 'c' && ary[i] >= 2) ret += comb(ary[i]); } System.out.println(ret); } private static long comb(int i) { return i * (i-1) / 2; } }