[s] = [i for i in input().split()]
cnt = 0

while "01" in s or "10" in s:
    s2 = s.replace("01", '', 1)
    if s2 != s:
        cnt = cnt + 2
    s3 = s2.replace("10", '', 1)
    if s3 != s2:
        cnt = cnt + 2
    s = s3

print(cnt)
