# ABC 120 C



import re



S = eval(input())



l0 = 0

l1 = 0



for i in range(len(S)):

    if S[i] == '0':

        l0 += 1

    elif S[i] == '1':

        l1 += 1



print((min(l0, l1) * 2))

def resolve():

  S = eval(input())

  arr = []

  for s in S:

    if len(arr) != 0 and arr[-1] != s:

      arr.pop()

    else:

      arr.append(s)



  print((len(S) - len(arr)))

  return



if __name__ == "__main__":

  resolve()

# ABC 120 C
import re

S = eval(input())
l0 = 0
l1 = 0
for i in range(len(S)):
    if S[i] == "0":
        l0 += 1
    elif S[i] == "1":
        l1 += 1
print((min(l0, l1) * 2))

def resolve():
    S = eval(input())
    arr = []
    for s in S:
        if len(arr) != 0 and arr[-1] != s:
            arr.pop()
        else:
            arr.append(s)
    print((len(S) - len(arr)))
    return


if __name__ == "__main__":
    resolve()

-# ABC 120 C -import re +def resolve(): +    S = eval(input()) +    arr = [] +    for s in S: +        if len(arr) != 0 and arr[-1] != s: +            arr.pop() +        else: +            arr.append(s) +    print((len(S) - len(arr))) +    return -S = eval(input()) -l0 = 0 -l1 = 0 -for i in range(len(S)): -    if S[i] == "0": -        l0 += 1 -    elif S[i] == "1": -        l1 += 1 -print((min(l0, l1) * 2)) + +if __name__ == "__main__": +    resolve()