from collections import *
from itertools import *
from functools import *
from heapq import *
import sys,math
input = sys.stdin.readline

S = list(input())[:-1]
C = [i=='c' for i in S]
W = [i=='w' for i in S]
SC = list(accumulate([0]+C))
SW = list(accumulate([0]+W))
N = len(S)
ans = 0
for i in range(1,N-1):
    if S[i]=='w':
        ans += SC[i]*(SW[-1]-SW[i+1])
print(ans)