l = str(input())
cnt = 0

while "10" in l:
    idx = l.index("10")
    ll = list(l)
    ll.pop(idx+1)
    ll.pop(idx)
    l = "".join(ll)
    cnt += 1

while "01" in l:
    idx = l.index("01")
    ll = list(l)
    ll.pop(idx+1)
    ll.pop(idx)
    l = "".join(ll)
    cnt += 1

print(cnt*2)