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()

def resolve():

  s = eval(input())

  red = 0

  blue = 0

  for c in s:

    if c == '0':

      red += 1

    else:

      blue += 1

  print((min(red, blue) * 2))

  return



if __name__ == "__main__":

  resolve()

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()

def resolve():
    s = eval(input())
    red = 0
    blue = 0
    for c in s:
        if c == "0":
            red += 1
        else:
            blue += 1
    print((min(red, blue) * 2))
    return


if __name__ == "__main__":
    resolve()

-    S = eval(input()) -    arr = [] -    for s in S: -        if len(arr) != 0 and arr[-1] != s: -            arr.pop() +    s = eval(input()) +    red = 0 +    blue = 0 +    for c in s: +        if c == "0": +            red += 1 -            arr.append(s) -    print((len(S) - len(arr))) +            blue += 1 +    print((min(red, blue) * 2))