import re



s = eval(input())

n = len(s)



one = [1 if si=="1" else 0 for si in s]

tmp=sum(one)

ret = min(tmp, n-tmp)*2



print(ret)
s = eval(input())

n = len(s)



one = [1 if si=="1" else 0 for si in s]

tmp=sum(one)

ret = min(tmp, n-tmp)*2



print(ret)
import re

s = eval(input())
n = len(s)
one = [1 if si == "1" else 0 for si in s]
tmp = sum(one)
ret = min(tmp, n - tmp) * 2
print(ret)

s = eval(input())
n = len(s)
one = [1 if si == "1" else 0 for si in s]
tmp = sum(one)
ret = min(tmp, n - tmp) * 2
print(ret)

-import re -