#!/usr/bin/env python3 s = input() c, w = [], [] for i in range(len(s)): if s[i] == 'c': c.append(i) elif s[i] == 'w': w.append(i) ans = 0 i, j = 0, 0 while i < len(c): while j < len(w) and w[j] < c[i]: j += 1 n = len(w) - j ans += n * (n-1) // 2 i += 1 print(ans)