package main

import "fmt"

func main() {
	var s string
	fmt.Scanf("%s", &s)
	total := 0
	countW := 0
	for i := 0; i < len(s); i++ {
		if s[i] == 'w' {
			countW += 1
		}
	}
	for i := 0; i < len(s); i++ {
		if s[i] == 'c' {
			total += countW * (countW - 1) / 2
		}else if s[i] == 'w' {
			countW -= 1
		}
	}
	fmt.Println(total)
}