import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String S = sc.next(); char[] charS = S.toCharArray(); long c = 0, w = 0; for(int i = S.length() - 1; i >= 0; i--) { if(charS[i] == 'c') { c+=w * (w - 1) / 2; } else if(charS[i] == 'w') { w++; } } System.out.println(c); } }