import java.util.Scanner; public class main { public static void main (String[] args){ Scanner sc = new Scanner(System.in); String S=sc.nextLine(); int slen= S.length(); long count =0; long ans=0; for(int i =slen-1;i>=0;i--){ if(S.charAt(i)=='w'){ count++; }else if(S.charAt(i)=='c'){ ans += count *(count-1)/2; } } System.out.println(ans); } }