import io.{StdIn => in}

object Main extends App {
  val s = in.readLine.map(c => if(c == 'W') true else false).toBuffer

  val ans = s./:((0, s.head))((acc, e) => {
    if(acc._2 != e) (acc._1 + 1, e)
    else (acc._1, e)
  })
  println(ans)
}
