s=list(eval(input()))

len_s=len(s)

cnt_1=0

for i in range(len_s):

    if s[i]=='1':

        cnt_1+=1

cnt_0=len_s-cnt_1

print((min(cnt_1,cnt_0)*2))
s=list(eval(input()))

cnt_1=s.count('1')

MIN=min(len(s)-cnt_1,cnt_1)

print((MIN*2))
s = list(eval(input()))
len_s = len(s)
cnt_1 = 0
for i in range(len_s):
    if s[i] == "1":
        cnt_1 += 1
cnt_0 = len_s - cnt_1
print((min(cnt_1, cnt_0) * 2))

s = list(eval(input()))
cnt_1 = s.count("1")
MIN = min(len(s) - cnt_1, cnt_1)
print((MIN * 2))

-len_s = len(s) -cnt_1 = 0 -for i in range(len_s): -    if s[i] == "1": -        cnt_1 += 1 -cnt_0 = len_s - cnt_1 -print((min(cnt_1, cnt_0) * 2)) +cnt_1 = s.count("1") +MIN = min(len(s) - cnt_1, cnt_1) +print((MIN * 2))