import java.util.*; public class Main { public static void main(String[] args) { Scanner sc = new Scanner(System.in); String s = sc.next(); int n = s.length(); long[] wk = new long[n]; for(int i = 0; i < n; i++) { if(s.charAt(i) == 'w') { if(i == 0) { wk[i] = 1; } else { wk[i] = wk[i - 1] + 1; } } else { wk[i] = wk[i - 1]; } } long ans = 0; for(int i = 0; i < n; i++) { if(s.charAt(i) == 'c') { long t = wk[n - 1] - wk[i]; ans += ((t * (t - 1)) / 2); } } System.out.println(ans); } }