s = input()
n = len(s)

cnt = 0

cnt01 = s.count('01')
cnt10 = s.count('10')

while cnt01 != 0 or cnt10 != 0:
    if cnt01 >= cnt10:
        s = s.replace('01', '')
        cnt += cnt01
    else:
        s = s.replace('10', '')
        cnt += cnt10

    cnt01 = s.count('01')
    cnt10 = s.count('10')

print(cnt * 2)
