s = input()
res = 0
while True:
    a = s.find('01')
    b = s.find('10')
    if a != -1 or b != -1:

        if a != -1:
            if b != -1:
                if a < b:
                    s = s[:a] + s[a + 2:]
                    res += 2
                else:
                    s = s[:b] + s[b + 2:]
                    res += 2
            else:
                s = s[:a] + s[a + 2:]
                res += 2
        else:
            s = s[:b] + s[b + 2:]
            res += 2
    else: break

print(res)