import java.util.Arrays

const val MOD: Long = (1e9+7).toLong()

fun main(args: Array<String>) {
    val s = readLine()!!

    val sb = StringBuilder("")
    var b = s[0]
    for (c in s) {
        if (c == b) {
            continue
        } else {
            sb.append(b)
            b = c
        }
    }
    sb.append(b)

    println(sb.length-1)
}
