import java.util.Scanner; public class Main { @SuppressWarnings("resource") public static void main(String args[]) { Scanner scanner = new Scanner(System.in); String s=scanner.next(); int cnt=0; int ans=0; for(int i=s.length()-1;i>=0;i--) { char c=s.charAt(i); if(c=='w') { cnt++; }else if(c=='c'){ ans+=calc(cnt-1); } } System.out.println(ans); } private static int calc(int cnt) { int res=0; for(int i=cnt;i>0;i--) { res+=i; } return res; } }