import re

tmp = raw_input()

length = len(tmp)


for i in range(length/2):
    tmp = tmp.replace("01", "")
    tmp = tmp.replace("10", "")


length2 = len(tmp)

division = length - length2

print(division)