# 
# 
# def find_index(i, stack):
#     while i < len(stack):
#         if stack[i] == stack[i-1]:
#             return i
#         i += 1
#     return i
# 
# def find_index2(i, stack, plus):
#     while i < len(stack):
#         if stack[i] == plus and stack[i] == stack[i-1]:
#             return i
#         i += 1
#     return i
# 
# 
# def flip(i1, i2, stack):
#     for flipi in range((i2 - i1 + 1) // 2):
#         stack[i1 + flipi], stack[i2 - flipi] = stack[i2 - flipi], stack[i1 + flipi] 
# 
# stack = list(map(lambda x: x == '+', input()))
# # stack = [True, False, True, False, False, True]
# # print(stack)
# 
# count = 0
# 
#     
# 
# i = 1
# while True:
#     index1 = find_index(i, stack)
#     if index1 == len(stack):
#         print(count)
#         break
#     index2 = find_index2(index1 + 1, stack, not stack[index1])
#     
#     flip(index1, index2 - 1, stack)
#     count += 1
#

    
stack = list(map(lambda x: x == '+', input()))



first = stack[0]

count = 0
for i in range(1, len(stack)):
    if stack[i] == (not first) and stack[i] == stack[i - 1]:
        count += 1
print(count)


