# S = '0011'
# S = '11011010001011'
# S = '0'
S = input()

cnt = 0


def www(s):
    global cnt

    if len(s) <= 1:
        return

    index = 0
    tmp = []
    c = 0

    while True:
        if len(s) < index + 1:
            break
        if s[index] == '0' and s[index + 1] == '1':
            index += 1
            c += 2
        else:
            tmp.append(S[index])
        index += 1
    cnt += c

    if 0 < c:
        www(tmp)


www(S)
print(cnt)
