def compute():

    from sys import stdin

    S = stdin.readline().strip()



    wew = []

    for x in S:

        if len(wew)>0 and wew[-1]!=x:

            wew.pop()

        else:

            wew.append(x)



    print((len(S) - len(wew)))



if __name__ == "__main__":

    compute()

def compute():

    from sys import stdin

    S = stdin.readline().strip()

    l = len(S)



    x = S.count("1")

    y = min(x, l-x)

    print((y<<1))



if __name__ == "__main__":

    compute()

def compute():
    from sys import stdin

    S = stdin.readline().strip()
    wew = []
    for x in S:
        if len(wew) > 0 and wew[-1] != x:
            wew.pop()
        else:
            wew.append(x)
    print((len(S) - len(wew)))


if __name__ == "__main__":
    compute()

def compute():
    from sys import stdin

    S = stdin.readline().strip()
    l = len(S)
    x = S.count("1")
    y = min(x, l - x)
    print((y << 1))


if __name__ == "__main__":
    compute()

-    wew = [] -    for x in S: -        if len(wew) > 0 and wew[-1] != x: -            wew.pop() -        else: -            wew.append(x) -    print((len(S) - len(wew))) +    l = len(S) +    x = S.count("1") +    y = min(x, l - x) +    print((y << 1))