S = input()
n = c = 0
while True:
    S = S.replace("01","#")
    S = S.replace("10","#")
    n += S.count("#")
    S = S.replace("#","")

    if c == n:
        break
    else:
        c = n
print(n*2)
