
s = input()

def switcher(first, s):
	start = -1
	for i in range(0, len(s)):
		if i % 2 == 0 and s[i] != first:
			start = i
			break
		elif i % 2 == 1 and s[i] == first:
			start = i
			break
	if start == -1:
		return 0
	for i in range(len(s) - 1, start, -1):
		if i % 2 == 0 and s[i] != first:
			end = i
			break
		elif i % 2 == 1 and s[i] == first:
			end = i
			break
	s = s[end:start:-1]
	if start % 2 == 0:
		return 1 + switcher(first, s)
	elif first == '-':
		return 1 + switcher('+', s)
	else:
		return 1 + switcher('-', s)


if s[0] != s[len(s) - 1]:
	sol = 0
	print(min(switcher('-', s), switcher('+', s)))
else:
	sol = 0
	print(switcher(s[0], s))

	
