s = input()

count = 0
while True:
    n = len(s)
    ints = sum(map(int, s))
    if n == 0 or ints == 0 or ints == n:
        break
    sn = s + '\n'
    for i in range(n):
        if sn[i-1] + sn[i] == '10' or sn[i-1] + sn[i] == '01':
            s = sn[:i-1] + sn[i+1:n]
            count += 1
            break

print(count * 2)