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