/* package whatever; // don't place package name! */ import java.util.*; import java.lang.*; import java.io.*; /* Name of the class has to be "Main" only if the class is public. */ class Ideone { public static void main (String[] args) throws java.lang.Exception { // your code goes here BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); String line = br.readLine(); ArrayList w_num = new ArrayList(); long w_cnt = 0; for(int i=line.length()-1;i>=0;i--){ char c = line.charAt(i); if(c == 'c'){ w_num.add(w_cnt); }else if(c == 'w'){ w_cnt++; } } long ans = 0; for(long w:w_num){ ans += combination(w); } System.out.println(ans); } public static long combination(long n){ return (n * (n-1)) / 2; } }