s = str(input())
cnt = 0
prev = len(s)
while len(s) > 1:
    for i in range(len(s) - 1):
        if (s[i] == '0' and s[i + 1] == '1') or (s[i] == '1' and s[i + 1] == '0'):
            cnt += 2
            s = s[:i] + 'xx' + s[i + 2:]
    s = s.replace('xx', '')
    if len(s) == prev:
        break
    prev = len(s)
print(cnt)
