b = list(map(int, input()))
cnt = 0
i = 0
while len(b) > 1:
    
    if len(list(set(b))) == 1:
        break
    if b[i] != b[i + 1]:
        b.pop(i)
        b.pop(i)
        cnt += 1
        i = 0
        continue
    i += 1
    
print(cnt*2)
