l = list(raw_input()) l.reverse() cnt = 0 w = 0 for c in l: if c == 'w': w += 1 elif c == 'c' and w >= 2: cnt += w * (w-1) / 2 print cnt