import java.io.BufferedReader; import java.io.IOException; import java.io.InputStreamReader; public class Test346 { public static void main(String[] args) { long result = 0; BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); try { long count_w = 0; String str = br.readLine(); char[] ch = str.toCharArray(); for(int i=ch.length-1;i>=0;i--){ if(ch[i]=='w'){ count_w++; }else if(ch[i]=='c'){ if(count_w >= 2){ result += count_w * (count_w - 1) / 2 ; } } } System.out.println(result); } catch (IOException e) { e.printStackTrace(); } } }