S = str(input())

count = 0
T = ""
while((len(S) >= 1) and ("0" in S) and ("1" in S)):
    if (S[0:2] == "01") or (S[0:2] == "10"):
        count += 2
        S = S[2:]
        T += S
        S = T
        T = ""
    else:
        T += S[0]
        S = S[1:]
print(count)