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

    S = S.replace("10","#")
    m += S.count("#")
    S = S.replace("#","")

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