import java.util.Scanner; public class Main { public static void main(String[] args) { Scanner scan = new Scanner(System.in); String S = scan.next(); scan.close(); int l = S.length(); int[]k = new int[l]; int cnt = 0; for(int i = 0; i < l; i++) { if(S.charAt(i) == 'w'){ cnt++; } k[i] = cnt; } long ans = 0; for(int i = 0; i < l; i++) { if(S.charAt(i) == 'c') { int m = cnt - k[i]; if(m >= 2) { ans += (long)m * (m - 1) / 2; }else { break; } } } System.out.println(ans); } }