s = input()
cnt = 0
while '10' in s:
    ind = s.find('10')
    s = str(s[0:ind]) + str(s[ind + 2:len(s)])
    #print(s)
    cnt = cnt + 2

while '01' in s:
    ind = s.find('01')
    # print(ind)
    s = str(s[0:ind]) + str(s[ind + 2:len(s)])
    #print(s)
    cnt = cnt + 2

print(cnt)