t = input()

z = 0
o = 0
count = 0
for c in t:
    if c == '0':
        if o > 0:
            o -= 1
            count += 2
        else:
            z += 1
    else:
        if z > 0:
            z -= 1
            count += 1
        else:
            o += 2
print(count)