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

i  = 1
counter = 0
length = len(S)
while i < length or length < 2:
	if S[i - 1] != S[i]:
		del(S[i - 1 : i + 1])
		counter += 1
		length -= 2
		i -= 1
	else:
		i += 1
		
print(counter * 2)