string = input()
stuck_zeros = 0
number_of_pair = 0
index = 0

while index < len(string):
    if string[index] == '0':
        stuck_zeros += 1
        index += 1
    else:
        if(stuck_zeros != 0):
            number_of_continues_1 = 1
            for i in range(index + 1, len(string)):
                index += 1
                if (string[i] == '1'):
                    number_of_continues_1 += 1
                else:
                    index -= 1
                    break
            if (stuck_zeros > number_of_continues_1):
                number_of_pair += number_of_continues_1
                stuck_zeros -= number_of_continues_1
            else:
                number_of_pair += stuck_zeros
                stuck_zeros = 0
        else:
            index += 1


print(number_of_pair * 2)
