let rec solve acc c i s =
  if String.length s <= i then acc
  else
    if s.[i] = 'W'
    then solve (c + acc) c (i + 1) s
    else solve acc (1 + c) (i + 1) s
let solve = solve 0 0 0


let () =
  let s = read_line () in
  Printf.printf "%d\n" @@ solve s

