s = input() n = len(s) ans = 0 w = s.count('w') if w <= 1: print(ans) exit() for i in range(n): if s[i] == 'c': tmp = s[i:] w = tmp.count('w') if w >= 2: ans += w*(w-1) // 2 print(ans)