def check_01(inp):
    remove_list = []
    for i in range(1,len(inp)):
        if int(inp[i-1]) + int(inp[i]) ==1:
            remove_list.append(i)
    if remove_list:
        return remove_list
    else:
        return None
inp = list(input())
k = 0
while True:
    lists = check_01(inp)
    if lists is not None:
        k += 1
        for r in lists:
            del inp[r-1:r]
    else:
        break
print(k*2)