import java.util.Scanner; public class Main_yukicoder346 { public static void main(String[] args) { Scanner sc = new Scanner(System.in); char[] s = sc.next().toCharArray(); int n = s.length; int[] cnt = new int[n + 1]; for (int i = n - 1; i >= 0; i--) { cnt[i] = cnt[i + 1]; if (s[i] == 'w') { cnt[i]++; } } long ret = 0; for (int i = 0; i < n; i++) { if (s[i] == 'c' && cnt[i + 1] >= 2) { ret += (long)cnt[i + 1] * (cnt[i + 1] - 1) / 2; } } System.out.println(ret); sc.close(); } }