import java.util.Scanner; public class Chiwawa { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ Scanner s = new Scanner(System.in); StringBuilder str = new StringBuilder(s.nextLine()); s.close(); int all = 0; while(str.indexOf("c") != -1){ int t = str.indexOf("c"); int count = 0; for(int i = t;i < str.length();i++){ if(str.charAt(i) == 'w'){ count++; } } all += Combination(count,2); str.deleteCharAt(t); } System.out.println(all); } static int Combination(int r,int q){ int rCq = 1; for(int i = 1;i <= q;i++){ rCq = rCq * r-- / i; } return rCq; } }