#coding: utf-8
s = list(map(int, input()))
cnt = 0
while len(set(s)) > 1:
    for i in range(len(s)-1):
        if s[i] == 1 and s[i+1] == 0:
            cnt += 2
            del s[i:i+2]
            break
print(cnt)