package main import ( "bufio" "fmt" "os" ) func main() { var s string sc.Scan() s = sc.Text() 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)