import queue

q=queue.Queue()

s=list(eval(input()))

c=0

for i in s:

  if q.empty():

    q.put(i)

  else:

    a=q.get()

    if a!=i:

      c+=2

    else:

      q.put(a)

      q.put(i)

print(c)
import math,string,itertools,fractions,heapq,collections,re,array,bisect,sys,random,time



sys.setrecursionlimit(10**7)

inf=10**20

mod=10**9+7



def LI(): return list(map(int,input().split()))

def I(): return int(eval(input()))

def LS(): return input().split()

def S(): return eval(input())



def main():

  s=S()

  return min(s.count('0'),s.count('1'))*2



print((main()))

import queue

q = queue.Queue()
s = list(eval(input()))
c = 0
for i in s:
    if q.empty():
        q.put(i)
    else:
        a = q.get()
        if a != i:
            c += 2
        else:
            q.put(a)
            q.put(i)
print(c)

import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time

sys.setrecursionlimit(10**7)
inf = 10**20
mod = 10**9 + 7


def LI():
    return list(map(int, input().split()))


def I():
    return int(eval(input()))


def LS():
    return input().split()


def S():
    return eval(input())


def main():
    s = S()
    return min(s.count("0"), s.count("1")) * 2


print((main()))

-import queue +import math, string, itertools, fractions, heapq, collections, re, array, bisect, sys, random, time -q = queue.Queue() -s = list(eval(input())) -c = 0 -for i in s: -    if q.empty(): -        q.put(i) -    else: -        a = q.get() -        if a != i: -            c += 2 -        else: -            q.put(a) -            q.put(i) -print(c) +sys.setrecursionlimit(10**7) +inf = 10**20 +mod = 10**9 + 7 + + +def LI(): +    return list(map(int, input().split())) + + +def I(): +    return int(eval(input())) + + +def LS(): +    return input().split() + + +def S(): +    return eval(input()) + + +def main(): +    s = S() +    return min(s.count("0"), s.count("1")) * 2 + + +print((main()))