import sys
input = sys.stdin.readline
s = input()
n = len(s)
a = []
i = 0
ct = 0
for i in range(n):
    a.append(int(s[i]))
i = -1

while ct < 100000000000:
    n = len(a)
    i += 1
    if i >= n - 1: break
    if a[i] == 0 and a[i + 1] == 1:
        a.pop(i)
        a.pop(i)
        ct += 1
        i -= 2
        if i <= 1: i = -1
        continue
    elif a[i] == 1 and a[i + 1] == 0:
        a.pop(i)
        a.pop(i)
        ct += 1
        i -= 2
        if i <= 1: i = -1

print(ct * 2)
