def main():
    S = input()
    cnt = 0
    l_past  = None
    l_new = None
    block = list(S)
    for i in range(10**5):
        block = [ a for a in block if a != "-"]
        l_new = len(block)

        if l_past == l_new :
            break

        for i in range(len(block) - 1):
            if (block[i] == "0" and block[i+1] == "1") or (block[i] == "1" and block[i+1] == "0"):
                cnt += 2
                block[i] = "-"
                block[i+1] = "-"

        l_past = l_new

    print(cnt)
    
if __name__ == "__main__":
    main()