data = input()
data_list = [c for c in data]
#print(data_list)
count = 1
delete_count = 0
while ('0' in data_list) and ('1' in data_list):
    if data_list[count - 1] != data_list[count]:
        del data_list[count - 1: count + 1]
        delete_count += 2
        count = 1
    else:
        count += 1

print(delete_count)
