# -*- coding: utf-8 -*-

s = list(eval(input()))



tmp = []

ans = 0

for i in range(len(s)):

    if len(tmp) > 0 and tmp[-1] == '0' and s[i] == '1':

        tmp.pop()

        ans += 2

    elif len(tmp) > 0 and tmp[-1] == '1' and s[i] == '0':

        tmp.pop()

        ans += 2

    else:

        tmp.append(s[i])

print(ans)

# -*- coding: utf-8 -*-

s = list(eval(input()))



ans = min(s.count('0'), s.count('1'))

print((ans * 2))

# -*- coding: utf-8 -*-
s = list(eval(input()))
tmp = []
ans = 0
for i in range(len(s)):
    if len(tmp) > 0 and tmp[-1] == "0" and s[i] == "1":
        tmp.pop()
        ans += 2
    elif len(tmp) > 0 and tmp[-1] == "1" and s[i] == "0":
        tmp.pop()
        ans += 2
    else:
        tmp.append(s[i])
print(ans)

# -*- coding: utf-8 -*-
s = list(eval(input()))
ans = min(s.count("0"), s.count("1"))
print((ans * 2))

-tmp = [] -ans = 0 -for i in range(len(s)): -    if len(tmp) > 0 and tmp[-1] == "0" and s[i] == "1": -        tmp.pop() -        ans += 2 -    elif len(tmp) > 0 and tmp[-1] == "1" and s[i] == "0": -        tmp.pop() -        ans += 2 -    else: -        tmp.append(s[i]) -print(ans) +ans = min(s.count("0"), s.count("1")) +print((ans * 2))