s = input()

ans = 0

while True:
    if s.count('01') != 0:
        ans += s.count('01')*2
        s=s.replace('01', '')
    elif s.count('10') != 0:
        ans += s.count('10')*2
        s=s.replace('10', '')
    else:
        break

print(ans)
