N = input()

ans = 0
update_N = N
flg = False
while set(list(update_N)) == set(['0', '1']):
    update_N = []
    for i in range(len(N) - 1):
        if flg is True:
            flg = False
            continue
        if N[i] + N[i + 1] == '10' or N[i] + N[i + 1] == '01':
            flg = True
            ans += 1
        else:
            update_N += N[i]
    if N[:-2] + N[:-1] != '10' and N[:-2] + N[:-1] != '01':
        update_N += N[-1]
    N = update_N
print(ans * 2)