def resolve():

	s = eval(input())

	c = 0

	for i in range(len(s) - 1):

		if s[i] != s[i+1]:

			c += 1

	print(c)

resolve()
def resolve():

	s = eval(input())

	c = 0

	for i in range(len(s) - 1):

		if s[i] != s[i+1]:

			c += 1

	if not c:

		print((0))

		return

	print(c)

resolve()
def resolve():
    s = eval(input())
    c = 0
    for i in range(len(s) - 1):
        if s[i] != s[i + 1]:
            c += 1
    print(c)


resolve()

def resolve():
    s = eval(input())
    c = 0
    for i in range(len(s) - 1):
        if s[i] != s[i + 1]:
            c += 1
    if not c:
        print((0))
        return
    print(c)


resolve()

+    if not c: +        print((0)) +        return