C = [int(i) for i in input()]

def recursive(list):
    if len(list) == 0:
        return []
    for i,l in enumerate(list):
        if i == len(list) -1:
            break
        if list[i] ==0 and list[i + 1] == 1:
            list.pop(i)
            list.pop(i)
            recursive(list)

recursive(C)
print(len(C))

