def main():

    S = list(map(int,list(eval(input()))))



    count_0 = 0

    count_1 = 0

    for val in S:

        if val == 0:

            count_0 += 1

        else:

            count_1 += 1

    print((min(count_0, count_1)*2))





if __name__ == '__main__':

    main()

def main():

    S = eval(input())



    zero = S.count('0')

    one = S.count('1')

    print((min(zero, one)*2))





if __name__ == '__main__':

    main()

def main():
    S = list(map(int, list(eval(input()))))
    count_0 = 0
    count_1 = 0
    for val in S:
        if val == 0:
            count_0 += 1
        else:
            count_1 += 1
    print((min(count_0, count_1) * 2))


if __name__ == "__main__":
    main()

def main():
    S = eval(input())
    zero = S.count("0")
    one = S.count("1")
    print((min(zero, one) * 2))


if __name__ == "__main__":
    main()

-    S = list(map(int, list(eval(input())))) -    count_0 = 0 -    count_1 = 0 -    for val in S: -        if val == 0: -            count_0 += 1 -        else: -            count_1 += 1 -    print((min(count_0, count_1) * 2)) +    S = eval(input()) +    zero = S.count("0") +    one = S.count("1") +    print((min(zero, one) * 2))