s = input()
s2 = s
s = list(s)
s2 = list(s2)
count = 0
s_leng = len(s)
while s_leng >= 2:
    for i in range(1, s_leng):
        i0 = s[i-1]
        i1 = s[i]
        if i0 != i1:
            s2.pop(i)
            s2.pop(i-1)
            count += 2
            s_leng -= 2
            s = s2
            break
    try:
        pk = [0, 1]
        pk.pop(int(s[0]))
        ik = str(pk[0])
        if ik not in s:
            break
    except:
        pass
    
    
print(count)


