s = raw_input().strip()
N = len(s)
l = [int(c) for c in s]

nl = []
i = 0
while i < N:
    if len(nl) > 0:
        a = nl[-1]
        b = l[i]

        if a + b == 1:
            nl.pop()
            i += 1
        else:
            nl.append(l[i])
            i += 1
    else:
        nl.append(l[i])
        i += 1

print N - len(nl)