package yukicoder; import java.util.*; public class Main{ public static void main(String[] args)throws Exception{ new Main().solve(); } void solve(){ Scanner sc=new Scanner(System.in); String str=sc.next(); long m=0; long ans=0; for(int i=str.length()-1;i>=0;i--){ if(str.charAt(i)=='w')m++; else if(str.charAt(i)=='c')ans+=combination(m); } System.out.println(ans); sc.close(); } //nC2 long combination(long n){ return (n*(n-1))/2; } }