s = [int(x) for x in input()]
ans = 0
cnt = 1

while cnt>0:
	cnt = 0
	for i in range(len(s)-1):
		if s[i] + s[i+1] == 1:
			s[i]=2
			s[i+1]=2
			cnt = 1
			ans+=1
		# print(s)
	while 2 in s:
		s.remove(2)
	# print(s)

print(ans)
