fun main(args: Array<String>) {
    val s = readLine()!!
    var pre = s[0]
    var border = 0
    for (i in 1..(s.length - 1)) {
        if (pre != s[i]) {
            pre = s[i]
            border++
        }
    }
    println(border)
}
