s = input()
ss = s
leng = 1
while leng != 0:
	ollen = len(s)
	s = s.replace('01','')
	s = s.replace('10','')
	nwlen = len(s)
	if ollen != nwlen:
		leng = abs(ollen - nwlen)
	else:
		leng = 0

print (len(ss)-len(s))
