s = input()

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

print(count * 2)