from collections import Counter

s=eval(input())

if len(set(s))==1:

    print((0))

else:

    c=Counter(s).most_common()

    print((c[1][1]*2))
s=eval(input())

n=len(s)

if len(set(s))==1:

    print((0))

else:

    c=s.count('1')

    print((min(c,n-c)*2))
from collections import Counter

s = eval(input())
if len(set(s)) == 1:
    print((0))
else:
    c = Counter(s).most_common()
    print((c[1][1] * 2))

s = eval(input())
n = len(s)
if len(set(s)) == 1:
    print((0))
else:
    c = s.count("1")
    print((min(c, n - c) * 2))

-from collections import Counter - +n = len(s) -    c = Counter(s).most_common() -    print((c[1][1] * 2)) +    c = s.count("1") +    print((min(c, n - c) * 2))