import java.util.*; class Main { public static void main(String[] args) { Scanner in = new Scanner(System.in); String s = in.next(); int l = s.length(); int ans = 0; int wc = 0, cc = 0; for(int i=l-1; i>=0; i--) { if(s.charAt(i) == 'w') wc++; if(s.charAt(i) == 'c') ans += wc * (wc-1) / 2; } System.out.println(ans); } }