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