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