fun main(args: Array<String>) {
    var result: Long = 0
    var count = 0
    for (c in readLine()!!) {
        if (c == 'W') {
            result += count
        } else count++
    }
    println(result)
}