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

cnt = 0
idx = 1
prv = S[0]
while idx < len(S):
	if S[idx] != prv:
		cnt += 2
		del S[idx]
		del S[idx-1]
		if len(S) > 0:
			idx = 1
			prv = S[0]
		else:
			break
	else:
		prv = S[idx]
		idx += 1
		
print(cnt)