object Main {
  def main(args: Array[String]): Unit = {
    val source = readLine().split("").toList
    println(source.reduce {
      (prev, cur) => if (prev.reverse.head.toString != cur) prev + cur else prev
    }.length - 1)
  }
}
