import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class QuestionB { public static void main(String[] args) { // TODO 自動生成されたメソッド・スタブ BufferedReader in = new BufferedReader(new InputStreamReader(System.in)); String line; try{ line = in.readLine(); }catch(IOException e){ System.out.println("0"); return; } int result = 0; int wcount = 0; boolean check = false; for(int i = line.length() - 1; i >= 0; i--){ if(line.charAt(i) == 'c') result += wcount * (wcount - 1)/2; if(line.charAt(i) == 'w'){ wcount++; } } System.out.println(result); } }