S = input()

count = 0
index = -1

list = [s for s in S]
for i in range(len(list)) :
    if index < 0 :
        index = i
    if (list[index] == "0" and list[i - 1] == "1") or (list[index] == "1" and list[i - 1] == "0") :
        count += 2
        index = i - 2
    else :
        index = i - 1
print(count)


'''
while True :
    length = len(S)
    S = S.replace("01", "")
    S = S.replace("10", "")
    if (length == len(S)) :
        break
    count += length - len(S)
print(count)
'''