S = input()
S = list(S)
count_p = 0
count = 0

mark = 1
if len(S) <= 1:
    print(0)
    mark = 0
while mark:
    i = 0
    while i < len(S)-1:
        if int(S[i])+int(S[i+1]) == 1:
            S[i] = '2'
            S[i+1] = '2'
            count += 2
            i += 2
        else:
            i += 1
    if count == count_p:
        print(count)
        break
    else:
        count_p = count
        S = [e for e in S if e!='2']
