S =list(input())
L =list(map(int,S))

n = 0
X = 0
can = []

while X<1:
	# print(L)
	K = len(L)-1
	# print(K)
	for i in range(K):
		if L[i]+L[i+1]==1:
			can.append(i)
			n=n+1
		elif i == K-1 and len(can)==0:
			X=1
		elif i == K-1:
			for j in reversed(can):
				# print(can)
				L.pop(j)
				can=[]

# print(L)
print(n*2)