S = eval(input())

cnt0,cnt1 = 0,0

for s in S:

    if s=="0":

        cnt0 += 1

    else:

        cnt1 += 1

print((min(cnt0,cnt1)*2))
# Python3 (3.4.3)

import sys

input = sys.stdin.readline



# -------------------------------------------------------------

# function

# -------------------------------------------------------------





# -------------------------------------------------------------

# main

# -------------------------------------------------------------

S = input().rstrip()



r = S.count("0")

b = S.count("1")



print((min(r,b)*2))
S = eval(input())
cnt0, cnt1 = 0, 0
for s in S:
    if s == "0":
        cnt0 += 1
    else:
        cnt1 += 1
print((min(cnt0, cnt1) * 2))

# Python3 (3.4.3)
import sys

input = sys.stdin.readline
# -------------------------------------------------------------
# function
# -------------------------------------------------------------
# -------------------------------------------------------------
# main
# -------------------------------------------------------------
S = input().rstrip()
r = S.count("0")
b = S.count("1")
print((min(r, b) * 2))

-S = eval(input()) -cnt0, cnt1 = 0, 0 -for s in S: -    if s == "0": -        cnt0 += 1 -    else: -        cnt1 += 1 -print((min(cnt0, cnt1) * 2)) +# Python3 (3.4.3) +import sys + +input = sys.stdin.readline +# function +# main +S = input().rstrip() +r = S.count("0") +b = S.count("1") +print((min(r, b) * 2))