from sys import stdin def solve(): s = input() wc = s.count('w') ans = 0 for ch in s: if ch == 'c': ans += wc * (wc - 1) // 2 elif ch == 'w': wc -= 1 print(ans) def debug(x, table): for name, val in table.items(): if x is val: print('DEBUG:{} -> {}'.format(name, val), file=sys.stderr) return None if __name__ == '__main__': solve()