# -*- coding: utf-8 -*-

def main():
    s = input().split(" ")

    sl = list(s[0])
    prev = -1
    n = 0

    i = 0
    while True:
        if len(sl) <= i:
            break

        if (prev == 0 and sl[i] == '1') or (prev == 1 and sl[i] == '0'):
            # print(str(sl))
            # print("remove", i, prev, sl[i])
            del sl[i]
            del sl[i-1]
            n += 2
            if len(sl) <= i:
                break
            else:
                prev = int(sl[i-2])
                i = i-1
        else:
            prev = int(sl[i])
            i += 1

    print(n)

main()
