package main import ( "bufio" "fmt" "os" ) func main() { s := nextLine() lenS := len(s) var wCount, ans int for i := lenS - 1; i >= 0; i-- { if s[i] == 'w' { wCount++ } else if wCount >= 2 && s[i] == 'c' { ans += wCount * (wCount - 1) / 2 } } fmt.Println(ans) } var sc = bufio.NewScanner(os.Stdin) func nextLine() string { sc.Scan() return sc.Text() }