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

S = input()
cnt = 0

# O(N^2)は不可。
# 010がある時、01と10を取り除くパターンを作る？

# 時間超過
s = S
while True:
    c1, c2 = 0, 0
    ls = len(s)
    for i in range(ls-1):
        if s[i] == "0" and s[i+1] == "1":
            c1 += 1
        elif s[i] == "1" and s[i+1] == "0":
            c2 += 1
    if c1 == 0 and c2 == 0:
        break
    elif c1 >= c2:
        s = s.replace("01", "")
        cnt += c1*2
    else:
        s = s.replace("10", "")
        cnt += c2*2

print(cnt)