import re
a = input()
operations = 0
length_a = len(a)
if not re.search("01", a) and not re.search("01", a):
    print(0)
else:
    while re.search("01", a) or re.search("10", a):
        a = a.replace("01", "", 1)
        operations += 2 if length_a - len(a) == 2 else 0
        length_a = len(a)
        a = a.replace("10", "", 1)
        operations += 2 if length_a - len(a) == 2 else 0
        length_a = len(a)
    print(operations)