import java.util.Scanner

val sc = Scanner(System.`in`)

fun main(args : Array<String>) {
    val s = sc.next()!!

    var switched = 0
    var prev = '-'
    s.forEach {
        if (prev != '-' && prev != it) switched++
        prev = it
    }

    println(switched)
}