s=input()
si=len(s)//2+1
ns0=len(s)
ssum=0
for i in range(si):
    nsi=len(s)
#    s=s.replace("01","")
#    s=s.replace("10","")
    s=s.replace("01","").replace("10","")
    if nsi==len(s):
        break
print(ns0-nsi)
