def daruma(s):
    ans = 0
    s_stack = [s[0]]
    for i in range(1, len(s)):
        if len(s_stack) != 0:
            if s_stack[-1] + s[i] == "01" or s_stack[-1] + s[i] == "10":
                s_stack.pop()
                ans += 2
            else:
                s_stack.append(s[i])
        else:
            s_stack.append(s[i])
    return ans

def main():
    s = input()
    ans = daruma(s)
    print(ans)
