S = [int(_) for _ in eval(input())]

length = len(S)

temp = [S[0]]

for x in S[1:]:

    if(len(temp) == 0):

        temp.append(x)

    elif( temp[-1] == x):

        temp.append(x)

    else:

        temp.pop(-1)

print((length-len(temp)))

        
def main():

    A = eval(input())

    print((2*min(A.count("0"),A.count("1"))))

    

if __name__ == "__main__":

    main()
S = [int(_) for _ in eval(input())]
length = len(S)
temp = [S[0]]
for x in S[1:]:
    if len(temp) == 0:
        temp.append(x)
    elif temp[-1] == x:
        temp.append(x)
    else:
        temp.pop(-1)
print((length - len(temp)))

def main():
    A = eval(input())
    print((2 * min(A.count("0"), A.count("1"))))


if __name__ == "__main__":
    main()

-S = [int(_) for _ in eval(input())] -length = len(S) -temp = [S[0]] -for x in S[1:]: -    if len(temp) == 0: -        temp.append(x) -    elif temp[-1] == x: -        temp.append(x) -    else: -        temp.pop(-1) -print((length - len(temp))) +def main(): +    A = eval(input()) +    print((2 * min(A.count("0"), A.count("1")))) + + +if __name__ == "__main__": +    main()