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