s = input()
cnt = 0
while True:
    idx = s.find("01")
    if idx != -1:
        cnt += 2
        s = s[:idx] + s[idx+2:]
    idxx = s.find("10")
    if idxx != -1:
        cnt += 2
        s = s[:idxx] + s[idxx+2:]
    if idx == -1 and idxx == -1:
        break
print(cnt)