object Main extends App {
  val sc = new java.util.Scanner(System.in)
  val s = sc.next()
  if (s.length == 1) {
    println(0)
  } else {
    println(s.toSeq.sliding(2).count(t => t(0) != t(1)))
  }
}
