s = input()

import re
#re.findall('01', s)
ans = 0
while '01' in s or '10' in s:
    ans += len(re.findall('01', s))
    s = re.sub('01', '', s)
    ans += len(re.findall('10', s))
    s = re.sub('10', '', s)

print(ans * 2)