s = str(input())
i = 0
score = 0
str_length = len(s)
while True:
    str_length = len(s)
    if str_length == 2:
        if int(s[0]) ^ int(s[1]) == 1:
            score += 2
            print(score)
            exit()
        else:
            print(score)
            exit()
    i = 0
    while True:
        j = i + 1
        cur_num = int(s[j])
        prev_num = int(s[j-1])
        next_num = int(s[j+1])
        if (cur_num ^ prev_num) == 1:
            score += 2
            s = s[:j-1] + s[j+1:]
            break
            
        elif (cur_num ^ prev_num) == 1:
            score += 2
            s = s[:j] + s[j+2:]
            break
        else :
            i += 1
            if i == str_length:
                print(score)
                exit()
        