S = input()

ans1 = 0
onecount = 0
for i in range(len(S)):
    if S[i] == "0":
        if onecount > 0:
            ans1 += 2
            onecount -= 1
    else:
        onecount += 1

ans2 = 0
zerocount = 0
for i in range(len(S)):
    if S[i] == "1":
        if zerocount > 0:
            ans2 += 2
            zerocount -= 1
    else:
        zerocount += 1
print(max(ans1, ans2))
