S = input()
subS = S
cnt = 0
while True:
    flg = True
    if "01" in subS:
        flg = False
        tmp = subS.replace("01", "")
        cnt += len(subS) - len(tmp)
        subS = tmp
    if "10" in subS:
        flg = False
        tmp = subS.replace("10", "")
        cnt += len(subS) - len(tmp)
        subS = tmp
    if flg:
        break