def main():

    from collections import Counter



    s = eval(input())



    ctr = Counter(s)

    ctr.update({'0': 0, '1': 0})



    ans = min(ctr.values()) * 2



    print(ans)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

def main():

    s = eval(input())

    mi = min(s.count(c) for c in '01')

    ans = mi * 2

    print(ans)





if __name__ == '__main__':

    main()



# import sys

#

# sys.setrecursionlimit(10 ** 7)

#

# input = sys.stdin.readline

# rstrip()

# int(input())

# map(int, input().split())

def main():
    from collections import Counter

    s = eval(input())
    ctr = Counter(s)
    ctr.update({"0": 0, "1": 0})
    ans = min(ctr.values()) * 2
    print(ans)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

def main():
    s = eval(input())
    mi = min(s.count(c) for c in "01")
    ans = mi * 2
    print(ans)


if __name__ == "__main__":
    main()
# import sys
#
# sys.setrecursionlimit(10 ** 7)
#
# input = sys.stdin.readline
# rstrip()
# int(input())
# map(int, input().split())

-    from collections import Counter - -    ctr = Counter(s) -    ctr.update({"0": 0, "1": 0}) -    ans = min(ctr.values()) * 2 +    mi = min(s.count(c) for c in "01") +    ans = mi * 2