t = input()
s = [c for c in t]
count = 0
while True and len(s)>1:
    u = []
    tmp = len(s)
    for i in range(len(s)-1):
        if int(s[i])+int(s[i+1]) == 1:
            s[i+1] = '2'
            count += 2
        elif not s[i] == '2':
            u.append(s[i])
    s = u
    if tmp == len(s):
        break
print(count)
            