s = input()
ans = 0
flg = 0
while flg == 0:
    ans += s.count('01') * 2
    s = s.replace('01', '')
    ans += s.count('10') * 2
    s = s.replace('10', '')
    if not ('10' in s or '01' in s):
        flg = 1
print(ans)