Problem:
 Score : 300 points    Problem Statement There are N cubes stacked vertically on a desk.  You are given a string S of length N . The color of the i -th cube from the bottom is red if the i -th character in S is 0 , and blue if that character is 1 .  You can perform the following operation any number of times: choose a red cube and a blue cube that are adjacent, and remove them. Here, the cubes that were stacked on the removed cubes will fall down onto the object below them.  At most how many cubes can be removed?      Constraints  1 \leq N \leq 10^5  |S| = N  Each character in S is 0 or 1 .         Input Input is given from Standard Input in the following format:  S       Output Print the maximum number of cubes that can be removed.        Sample Input 1 0011      Sample Output 1 4  All four cubes can be removed, by performing the operation as follows:   Remove the second and third cubes from the bottom. Then, the fourth cube drops onto the first cube.  Remove the first and second cubes from the bottom.        Sample Input 2 11011010001011      Sample Output 2 12       Sample Input 3 0      Sample Output 3 0

Solution (Python):
s=input();print(2*min(s.count("1"),s.count("0")))

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd
from itertools import accumulate

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    s = sys.stdin.readline().rstrip()
    n0 = s.count("0")
    n1 = s.count("1")

    print(min(n0,n1)*2)

Solution (Python):
S = str(input())
count_0 = S.count("0")
count_1 = S.count("1")

print(min(count_0, count_1)*2)

Solution (Python):
s = input()
print(min(s.count("0"), s.count("1")) * 2)

Solution (Python):
str_in = input()

cnt0 = 0
cnt1 = 0

for i in range(len(str_in)):
  if (int(str_in[i]) == 0):
    cnt0 += 1
  else:
    cnt1 += 1

ans = min([cnt0, cnt1]) * 2
print (ans)

Solution (Python):
x=input()

n=len(x)

one=x.count('1')
zero=n-one

res=min(one,zero)*2

print(res)

Solution (Python):



import sys


hoge = input()
n = len(hoge)

sum=0
i=0

while(1):

	if(i>=n-1):
		break
	if(hoge[i]!=hoge[i+1]):

		newhoge=hoge[0:i]+hoge[i+2:n]
		hoge=newhoge
		i-=1
		if(i<0):
			i=0
		n-=2

		sum+=2
	else:
		i+=1






print(sum)

Solution (Python):
s = str(input())
count_0 = 0
count_1 = 0

for i in range(len(s)):
  if s[i] == "0":
    count_0 += 1
  else:
    count_1 += 1
print(min(count_0, count_1)*2)

Solution (Python):
s = input()

s1 = 0
s0 = 0

for i in s:
    if i == "0":
        s0 += 1
    if i == "1":
        s1 += 1

ans = min(s0, s1) * 2
print(ans)

Solution (Python):
S = input()

n0 = len([s for s in S if s == "0"])
n1 = len([s for s in S if s == "1"])
print(len(S)-abs(n0-n1))

Solution (Python):
import sys
s2nn = lambda s: [int(c) for c in s.split(' ')]
ss2nn = lambda ss: [int(s) for s in ss]
ss2nnn = lambda ss: [s2nn(s) for s in ss]
i2s = lambda: sys.stdin.readline().rstrip()
i2n = lambda: int(i2s())
i2nn = lambda: s2nn(i2s())
ii2ss = lambda n: [sys.stdin.readline().rstrip() for _ in range(n)]
ii2sss = lambda n: [list(sys.stdin.readline().rstrip()) for _ in range(n)]
ii2nn = lambda n: ss2nn(ii2ss(n))
ii2nnn = lambda n: ss2nnn(ii2ss(n))

from collections import deque  

def main():
    S = i2s()
    q = deque()
    for s in S:
        if not q:
            q.append(s)
        else:
            t = q.pop()
            if s == t:
                q.append(t)
                q.append(s)
    n = len(S) - len(q)
    print(n)

main()

Solution (Python):
s = input()
zero = one = 0
for c in s:
    if c == '0':zero+=1
    else:one+=1
print(min(zero,one)*2)

Solution (Python):
a = input()
count_0 = 0
count_1 = 0

for i in a:
    if i == "0":
        count_0 += 1
    else:
        count_1 += 1

print(min(count_0, count_1) * 2)

Solution (Python):
S = list(map(int, list(input())))
l = [None]
ans = 0
for s in S:
    if l[-1] is None:
        l.append(s)
        continue
    if s == l[-1]:
        l.append(s)
    else:
        l.pop()
        ans += 2
print(ans)

Solution (Python):
s=input()
z=s.count('0')
o=s.count('1')
print(len(s)-abs(z-o))

Solution (Python):


s=input()

cnt=0
for e in s:
    if e=='1':cnt+=1
    else:cnt-=1
print(len(s)-abs(cnt))

Solution (Python):
s = input()
count = 0

for i in range(len(s)):
    if s[i] == '0':
        count += 1

print(min((len(s)-count),count) * 2)

Solution (Python):
s = input()

a = s.count("0")
b = s.count("1")
c = min(a,b)
print(c*2)

Solution (Python):
S = input()

count = 0
for i in range(len(S)):
  if S[i] == "0":
    count += 1
    
print(2*min(count,len(S)-count))

Solution (Python):
S = str(input())
zeros = S.count("0")
ones = S.count("1")

print(min(zeros, ones) * 2)

Solution (Python):
s = input()
set_ = {'0', '1'}
arr = ['*']
for i in s:
    arr.append(i)
    if set(arr[-2:]) == set_:
        arr.pop()
        arr.pop()

ans = len(s) - len(arr) + 1
print(ans)

Solution (Python):
s = input()
set_ = set(['0', '1'])
arr = ['*']
for i in s:
    arr.append(i)
    if set(arr[-2:]) == set_:
        arr.pop()
        arr.pop()

ans = len(s) - len(arr) + 1
print(ans)

Solution (Python):
s = list(map(int,input()))

c = [s[0]]

for i in range(1,len(s)):
    c.append(s[i])
    if c[len(c)-1] != c[len(c)-2]:
        c.pop(len(c)-1)
        c.pop(len(c)-1)

print(len(s) - len(c))

Solution (Python):
S = input()
C = []
ans = 0
for s in S:
    len_c = len(C)
    if len_c == 0:
        C.append(s)
    else:
        if C[len_c-1] != s:
            ans += 2
            C.pop()
        else:
            C.append(s)
print(ans)

Solution (Python):


import re

S = 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)

Solution (Python):
s = input()
znum = 0
onum = 0
for i in s:
  if i == "0":
    znum+=1
  else:
    onum+=1

print(2*min(znum,onum))

Solution (Python):
from collections import Counter
s = input()
cnt = Counter(s)
if len(cnt) == 1:
    print(0)
else:
    print(min(cnt.values()) * 2)

Solution (Python):
S = input()

zero = 0
one = 0
for i in range(len(S)):
	if S[i] == '0':
		zero += 1
	else:
		one += 1
print(min(zero,one)*2)

Solution (Python):
S=input()
red=S.count("0")
blue=S.count("1")
print(min(red,blue)*2)

Solution (Python):
S = input()
n0 = S.count('0')
print(2*min(n0, len(S)-n0))

Solution (Python):
s = input()
data = []
for i in s:
    data.append(int(i))
one = 0
zero = 0
for i in range(len(data)):
    if data[i] == 0:
        zero += 1
    else:
        one += 1

print(min(zero, one) * 2)

Solution (Python):
s = input()

counter={'0':0,'1':0}
for si in s:
  counter[si]+=1

diff = abs(counter['0']-counter['1'])

if diff ==0:
  print(len(s))
else:
  print(len(s) - diff)

Solution (Python):
s = input()
c1,c2=s.count('0'),s.count('1'),
print(min(c1,c2)*2)

Solution (Python):
S = [int(x) for x in str(input())]
ones = sum(S)
zeros = len(S)-ones
print(min(ones,zeros)*2)

Solution (Python):
s = list(map(int, input()))
s.sort()
sum_s = sum(s)
print(min(sum_s, len(s) - sum_s) * 2)

Solution (Python):
s=input()

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

Solution (Python):
s = input()
zero = s.count("0")
one = s.count("1")
print(2 * min(zero, one))

Solution (Python):
S=input()
red=S.count("0")
blue=S.count("1")
print(min(red,blue)*2)

Solution (Python):
from collections import Counter
S = input()
count_01 = Counter(S)
print(len(S)-abs(count_01['1']-count_01['0']))

Solution (Python):
S = input()

min_combi = min(S.count('0'), S.count('1'))
print(min_combi * 2)

Solution (Python):
S = input()
char_count = {"0": 0, "1": 0}
for s in S:
    char_count[s] += 1
print(2 * min(char_count.values()))

Solution (Python):
import sys
import math
from collections import deque

sys.setrecursionlimit(4100000)


def inputs(num_of_input):
    ins = [input() for i in range(num_of_input)]
    return ins


def solve(inputs):
    S = inputs[0]
    count_0 = 0
    count_1 = 0

    for s in S:
        if s == "0":
            count_0 += 1
        else:
            count_1 += 1

    return len(S) - abs(count_0 - count_1)


def string_to_int(string):
    return list(map(lambda x: int(x), string.split()))


if __name__ == "__main__":
    ret = solve(inputs(1))
    print(ret)

Solution (Python):
a = input()
b = len(a) - len(a.replace("1", ""))
c = len(a) - len(a.replace("0", ""))
print(min(b, c)*2)

Solution (Python):
s=input()
print(min(s.count('0'), s.count('1')) * 2)

Solution (Python):
s = input()
print(min(s.count(c) for c in '01') * 2)

Solution (Python):
from collections import Counter
s=input()
c=Counter(s)
print(min(c["0"],c["1"])*2)

Solution (Python):
from collections import deque
deq=deque()
s=input()
n=len(s)
for i in s:
    if len(deq)==0:
        deq.append(i)
        continue
    x=deq.pop()
    if x==i:
        deq.append(x)
        deq.append(i)
print(n-len(deq))

Solution (Python):
S = input()
n0 = 0
n1 = 0
for si in S:
    if si == "0":
        n0 += 1
    else:
        n1 += 1
print(2*min(n0,n1))

Solution (Python):
S = input()
lst = []
cnt = 0
for i in range(0, len(S)):
	if lst == []:
		lst.append(S[i])
	elif lst[-1] != S[i]:
		cnt += 2
		lst.pop(-1)
	else:
		lst.append(S[i])
print(cnt)

Solution (Python):
S = input()

N = len(S)

cnt_zero = 0
for i in range(N):
  if S[i] == '0':
    cnt_zero += 1
if cnt_zero <= N - cnt_zero:
  print(cnt_zero*2)
else:
  print((N-cnt_zero)*2)

Solution (Python):



s = list(input())
s_len = len(s)
arr = []
ctr = 0

for i in range(s_len):
    if arr == [] or s[i] == arr[-1]:
        arr.append(s[i])
    else:
        ctr += 2
        arr.pop()
print(ctr)

Solution (Python):
S = list(input())


zero = 0
one = 0
for i in S:
    if i == '0':
        zero += 1
    if i == '1':
        one += 1

ans = min(zero, one) * 2
print(ans)

Solution (Python):
s = input()
print(len(s)-abs(s.count("0")-s.count("1")))

Solution (Python):
S = input()
N = len(S)
cnt1 = 0
cnt2 = 0
for i in range(N):
  if S[i] =='0':
    cnt1 += 1
  else:
    cnt2 += 1
    
print(N-abs(cnt1-cnt2))

Solution (Python):
def main():

    """ convenient functions
    
    
    
    
    
    """

    """convenient decorator
    
    
        
        
        
        
        
        
        
        
        
        
    """
    
    
    import sys
    sys.setrecursionlimit(10**7)
    from itertools import accumulate, combinations, permutations, product 
    
    from math import factorial, ceil, floor, sqrt
    def factorize(n):
        """return the factors of the Arg and count of each factor
        
        Args:
            n (long): number to be resolved into factors
        
        Returns:
            list of tuples: factorize(220) returns [(2, 2), (5, 1), (11, 1)]
        """
        fct = []  
        b, e = 2, 0  
        while b * b <= n:
            while n % b == 0:
                n = n // b
                e = e + 1
            if e > 0:
                fct.append((b, e))
            b, e = b + 1, 0
        if n > 1:
            fct.append((n, 1))
        return fct
    def combinations_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        
        if n < 0 or r < 0:
            raise Exception('combinations_count(n, r) not defined when n or r is negative')
        if n - r < r: r = n - r
        if r < 0: return 0
        if r == 0: return 1
        if r == 1: return n
        numerator = [n - r + k + 1 for k in range(r)]
        denominator = [k + 1 for k in range(r)]
        for p in range(2,r+1):
            pivot = denominator[p - 1]
            if pivot > 1:
                offset = (n - r) % p
                for k in range(p-1,r,p):
                    numerator[k - offset] /= pivot
                    denominator[k] /= pivot
        result = 1
        for k in range(r):
            if numerator[k] > 1:
                result *= int(numerator[k])
        return result
    def combinations_with_replacement_count(n, r):
        """Return the number of selecting r pieces of items from n kinds of items allowing individual elements to be repeated more than once.
        
        Args:
            n (long): number
            r (long): number
        
        Raises:
            Exception: not defined when n or r is negative
        
        Returns:
            long: number
        """
        if n < 0 or r < 0:
            raise Exception('combinations_with_replacement_count(n, r) not defined when n or r is negative')
        elif n == 0:
            return 1
        else:
            return combinations_count(n + r - 1, r)
    from bisect import bisect_left, bisect_right
    from collections import deque, Counter, defaultdict 
    from heapq import heapify, heappop, heappush, heappushpop, heapreplace,nlargest,nsmallest 
    from copy import deepcopy, copy 
    import operator
    from operator import itemgetter
    
    
    from functools import reduce, lru_cache
    def chmin(x, y):
        """change minimum
        if x > y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current minimum value
            y (long): potential minimum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x > y:
            x = y
            return (x, True)
        else:
            return (x, False)
    def chmax(x, y):
        """change maximum
        if x < y, x = y and return (x, True).
        convenient when solving problems of dp[i]
        
        Args:
            x (long): current maximum value
            y (long): potential maximum value
        
        Returns:
            (x, bool): (x, True) when updated, else (x, False)
        """
        if x < y:
            x = y
            return (x, True)
        else:
            return (x, False)

    from fractions import gcd 
    def gcds(numbers):
        return reduce(gcd, numbers)
    def lcm(x, y):
        return (x * y) // gcd(x, y)
    def lcms(numbers):
        return reduce(lcm, numbers, 1)

    
    
    INF = 10 ** 18
    MOD = 10 ** 9 + 7
    modpow = lambda a, n, p = MOD: pow(a, n, p) 
    def modinv(a, p = MOD):
        
        
        return modpow(a, p-2, p)
    def modinv_list(n, p = MOD):
        if n <= 1:
            return [0,1][:n+1]
        else:
            inv_t = [0,1]
            for i in range(2, n+1):
                inv_t += [inv_t[p % i] * (p - int(p / i)) % p]
            return inv_t
    def modfactorial_list(n, p = MOD):
        if n == 0:
            return [1]
        else:
            l = [0] * (n+1)
            tmp = 1
            for i in range(1, n+1):
                tmp = tmp * i % p
                l[i] = tmp
            return l
    def modcomb(n, k, fac_list = [], p = MOD):
        
        
        from math import factorial
        if n < 0 or k < 0 or n < k: return 0
        if n == 0 or k == 0: return 1
        if len(fac_list) <= n:
            a = factorial(n) % p
            b = factorial(k) % p
            c = factorial(n-k) % p
        else:
            a = fac_list[n]
            b = fac_list[k]
            c = fac_list[n-k]
        return (a * modpow(b, p-2, p) * modpow(c, p-2, p)) % p
    def modadd(a, b, p = MOD):
        return (a + b) % MOD
    def modsub(a, b, p = MOD):
        return (a - b) % p
    def modmul(a, b, p = MOD):
        return ((a % p) * (b % p)) % p
    def moddiv(a, b, p = MOD):
        return modmul(a, modpow(b, p-2, p))

    """ initialize variables and set inputs
    
        
        
    
        
        
        
        
        
    
        
        
        
        
    
        
        
    """

    
    r = lambda: sys.stdin.readline().strip()
    r_int = lambda: int(r())
    R = lambda: list(map(int, r().split()))
    Rmap = lambda: map(int, r().split())
    Rfloat = lambda: list(map(float, r().split()))
    Rtuple = lambda: tuple(map(int, r().split()))

    """ how to treat input
    
    
    
    
    
    
    
    """

    if __name__ != '__main__':
        
        sys.stdin = open('sample.txt')

    
    

    S = r()
    zero = S.count('0')
    one = S.count('1')
    print(len(S)-abs(zero-one))
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    
    

    """memo: how to use defaultdict of list
    
    Dic = defaultdict(list)
    
    Dic[x].append(y)
    
    for k, v in Dic.items():
    """

if __name__ == '__main__':
    main()

Solution (Python):
s = input()

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

Solution (Python):
s = input()
s = list(s)
s = [int(x) for x in s]
print(2*min(s.count(0),s.count(1)))

Solution (Python):
def main():
    s = [int(x) for x in input()]
    n_ones = sum(s)
    print(2 * min(n_ones, len(s) - n_ones))


main()

Solution (Python):
S = input()

print(2 * min(S.count('0'), S.count('1')))

Solution (Python):
S = input()
tmp = ''

ret = 0
for s in S:
    if len(tmp) and tmp[-1] != s:
        ret += 1
        tmp = tmp[:-1]
    else:
        tmp += s

print(ret * 2)

Solution (Python):
S=list(input())

zero=S.count('0')
one=S.count('1')
print(2*min(zero,one))

Solution (Python):
S = input()
cont = S.count("0") - S.count("1")
print(len(S)-abs(cont))

Solution (Python):


S = input()

ans = min(S.count('0'), S.count('1'))
print(ans*2)

Solution (Python):
s = input()
zero = len([x for x in s if x == "0"])
one = len(s) - zero

print(min(zero, one) * 2)

Solution (Python):
s = list(input())
n = len(s)
s.sort()

num_0 = 0
num_1 = 0
for i in range(n):
    if s[i] == "1":
        num_0 = i
        break
num_1 = n - num_0


ans = 2*min(num_0,num_1)
print(ans)

Solution (Python):
s = input()
a = []
ans = 0
rev = {'0':'1', '1':'0'}
for c in s:
  if a and a[-1] == rev[c]:
    ans += 1
    a.pop()
  else:
    a.append(c)
print(ans * 2)

Solution (Python):
s = input()

ans = 0
c = '?'
x = 0
for i in range(len(s)):
    if c == '?':
        c = s[i]
        x = 1
    elif c != s[i]:
        x -= 1
        ans += 2
        if x == 0:
            c = '?'
    else:
        x += 1

print(ans)

Solution (Python):
def main():

    s = list(input())
    one = 0
    zero = 0
    for i in s:
        if i == '1':
            one += 1
        else:
            zero += 1
    print(min(one,zero) * 2)

if __name__ == "__main__":
    main()

Solution (Python):
S = input()
zero = S.count("0")
one = S.count("1")
print(min(zero, one) * 2)

Solution (Python):
a = input()
b = len(a) - len(a.replace("0", ""))
c = len(a) - len(a.replace("1", ""))
print(min(b, c) * 2)

Solution (Python):
s = input()

r = s.count("0")
b = s.count("1")
print(2*min(r, b))

Solution (Python):
s = input()
print(2 * min(s.count("0"), s.count("1")))

Solution (Python):
S = input()
print(min(S.count('0'), S.count('1')) * 2)

Solution (Python):
S = input()

count_0 = 0
count_1 = 0


for c in S:
    if c == '0':
        count_0 += 1
    else:
        count_1 += 1

print(min(count_0, count_1) * 2)

Solution (Python):
S = input()
import collections
li = [i for i in S]
if len(list(set(li))) == 2:
    d = collections.Counter(li)
    print(2*min(d["0"],d["1"]))
else:
    print(0)

Solution (Python):
from collections import deque
r=deque(map(int,list(input())))
l=deque()
cnt=0
while len(r)>0:
	if len(l)==0:
		l.append(r.popleft())
	if len(r)==0:
		break
	if l[-1] + r[0]==1:
		l.pop()
		r.popleft()
		cnt += 2
	else:
		l.append(r.popleft())
		
print(cnt)

Solution (Python):
S = list(input())

a = S.count('0')
b = S.count('1')
m = min(a, b)

print(2 * m)

Solution (Python):
S = input()
s = ['01', '10']
 
ans = 0
count = len(S)
i = 0
while count >= 2:
    if S[i:i + 2] in s:
        S = S[:i] + S[i + 2:]
        ans += 2
        count -= 1
        i -= 1
    else:
        i += 1
        count -= 1
 
print(ans)

Solution (Python):
s=input()
print(min(s.count('0'),s.count('1'))*2)

Solution (Python):

S = input()
numofzero = 0
numofone = 0
N = len(S)
for i in range(N):
    if S[i] == "0":
        numofzero += 1
    else:
        numofone += 1
if numofone > numofzero:
    print(numofzero*2)
else:
    print(numofone*2)

Solution (Python):
S = input()
numofzero = 0
numofone = 0
N = len(S)
for i in range(N):
    if S[i] == "0":
        numofzero += 1
    else:
        numofone += 1
if numofone > numofzero:
    print(numofzero*2)
else:
    print(numofone*2)

Solution (Python):
S = input()
blue = 0
red = 0
start = len(S)
for i in range(start):
  if S[i] == '0':
    red += 1
  elif S[i] == '1':
    blue += 1

block = min(red,blue)

print(2*block)

Solution (Python):
S = input()
s = ['01', '10']

ans = 0
count = len(S)
i = 0
while count >= 2:
    
    if S[i:i + 2] in s:
        S = S[:i] + S[i + 2:]
        ans += 2
        count -= 1
        i -= 1
    
    else:
        i += 1
        count -= 1

print(ans)

Solution (Python):
s=input()
zero=0
one=0
for i in range(0,len(s)):
	if(s[i:i+1]=="0"):
		zero+=1
	else:
		one+=1
print(min(zero,one)*2)

Solution (Python):
"""


 = sys.stdin.readline().rstrip()
 = list(sys.stdin.readline().rstrip())


 = int(sys.stdin.readline())
 = map(int, sys.stdin.readline().split())
 = list(map(int, sys.stdin.readline().split()))
 = [list(map(int,list(sys.stdin.readline().split()))) for i in range(h)]  


a = 100
b = 0.987654321
print("{0:06d}-{1:6f}".format(a,b))
000100-0.987654


char_list = list("abcd") 
"""

import math
import sys
import itertools
import queue
from fractions import gcd

def lcm(a, b):
    return a * b // gcd(a, b)

mod = 1000000007

if __name__ == "__main__":
    bit = list(sys.stdin.readline().rstrip())
    print(2 * min(bit.count("0"), bit.count("1")))

Solution (Python):
S=list(input())

red=0
blue=0
for i in range(len(S)):
    if S[i]=="0":
        red+=1
    else:
        blue+=1
        
print(min(red,blue)*2)

Solution (Python):
s = input()
n = len(s)
cnt = []
cnt.append(s.count('0'))
cnt.append(s.count('1'))

print(2 * min(cnt))

Solution (Python):
s = input()
cnt_one = s.count('1')
cnt_zero = len(s) - cnt_one
print(min(cnt_zero, cnt_one)*2)

Solution (Python):
s = input()
z = s.count('0')
o = s.count('1')
print(min(z,o)*2)

Solution (Python):
s = input()
c0 = 0
c1 = 0
for i in range(len(s)):
    if s[i] == "1":
        c1 += 1
    else:
        c0 += 1

if len(s) == 1:
    print(0)
else:
    print(min(c0, c1) * 2)

Solution (Python):
s = input()
zeros = s.count("0")
ones = s.count("1")
print(min(zeros, ones)*2)

Solution (Python):
S=input()
len=len(S)
R=0
B=0
for i in range(len):
    if S[i]=='0':
        R+=1
    else:
        B+=1

print(len-abs(R-B))

Solution (Python):
import numpy as np
import math


s = input()

count_1 = 0
count_0 = 0

for c in s:
    if c == '1':
        count_1 += 1
    if c == '0':
        count_0 += 1

print(2* min(count_0, count_1))

Solution (Python):
S = input()
ans = 0
stack = []
for i in range(len(S)):
    if len(stack)==0:
        stack.append(S[i])
        continue
    if S[i] != stack[-1]:
        ans += 2
        stack.pop()
    else:
        stack.append(S[i])
print(ans)

Solution (Python):
S = list(map(int, input()))

print(min(S.count(0), S.count(1)) * 2)

Solution (Python):
s=str(input())
print(min(s.count("1"),s.count("0"))*2)

Solution (Python):
s = input()
ans = min(s.count("1"), s.count("0")) * 2
print(ans)

Solution (Python):
S = input()
c0, c1 = 0, 0
for i in range(len(S)):
    if S[i] == '0':
        c0 += 1
    else:
        c1 += 1

print(2*min(c0, c1))

Solution (Python):
S = str(input())
print(int(len(S)-abs(S.count("0")-S.count("1"))))

Solution (Python):
s = input()

a = s.count("0")
print(min(a, len(s) - a) * 2)

Solution (Python):


S = input()
one = S.count('1')
zero = S.count('0')
answer = min(one, zero) * 2
print(answer)

Solution (Python):
s = input()
cnt1, cnt2 = s.count('1'), s.count('0')
print(min(cnt1, cnt2) * 2)

Solution (Python):
import sys
S = str(input())



S_dict = {}
if len(S) == 1:
    print(0)
    sys.exit()

for letter in S:
    if letter == '1':
        if letter in S_dict:
            S_dict[letter] += 1
        else:
            S_dict[letter] = 1
    elif letter == '0':
        if letter in S_dict:
            S_dict[letter] += 1
        else:
            S_dict[letter] = 1

if len(S_dict.values()) == 1:
    print(0)
    sys.exit()
print(min(S_dict.values()) * 2)

Solution (Python):
s = [i for i in input()]
one,zero = [0],[0]
for i in range(len(s)):
    if s[i] == '1': one.append(one[i]+1)
    else:   one.append(one[i])
    if s[i] == '0': zero.append(zero[i]+1)
    else:   zero.append(zero[i])
print(min(one[-1],zero[-1])*2)

Solution (Python):
S = list(input())
a = S.count("0")
b = S.count("1")
if a == b:
    print(a * 2)
elif a > b:
    print(b * 2)
elif a < b:
    print(a * 2)

Solution (Python):
s=input()
print(2*min(s.count('0'),s.count('1')))

Solution (Python):
s = input()
n0 = s.count("0")
n1 = s.count("1")
print(min(n0,n1)*2)

Solution (Python):
s1 = input()

r1 = 0
b1 = 0

for i1 in range(len(s1)):
    if s1[i1] == "0":
        r1 += 1
    else:
        b1 += 1

print(min(r1, b1) * 2)

Solution (Python):
s = input()
s1 = []
for i in range(len(s)):
    s1.append(s[i])
print(min(s1.count("1"), s1.count("0"))*2)

Solution (Python):
s = input()
zero = 0
one = 0
for i in range(len(s)):
    if s[i]=='0':
        zero+=1
    else:
        one+=1
print(2*(min(zero,one)))

Solution (Python):
s = input()
number = min(s.count('1'),s.count('0'))
print(number*2)

Solution (Python):
a,b=0,0
for i in input():
  if i=="1":a+=1
  else:b+=1
print(2*min(a,b))

Solution (Python):
S=list(map(int,input()))
print(len(S)-abs(S.count(0)-S.count(1)))

Solution (Python):
s = input()
s0 = s.count("0")
s1 = s.count("1")
print(len(s)-(max(s0,s1)-min(s0,s1)))

Solution (Python):
s = input()

s0 = s.count("0")
s1 = s.count("1")


print(len(s)-(max(s0,s1)-min(s0,s1)))

Solution (Python):
S = list(input())
N = len(S)
count0 = 0
for i in range(N):
    if S[i] == '0':
        count0 += 1        
count1 = N - count0
print(2 * min(count0,count1))

Solution (Python):

s = input()
one, zero = 0, 0
for sv in s:
    if sv == "0":
        zero += 1
    else:
        one += 1
print(min(zero, one)*2)

Solution (Python):
S=input();print(min([S.count('1'),S.count('0')])*2)

Solution (Python):
S=list(map(int,list(input())))
Snew=[-1]
for i in S:
    if Snew[-1]==i or Snew[-1]==-1:
        Snew.append(i)
    else:Snew.pop()
print(len(S)-len(Snew)+1)

Solution (Python):
s = list(input())
red = 0
blue = 0

for i in s:
  if i == '0':
    red = red+1
  elif i == '1':
    blue = blue+1
    
print(2*min(red,blue))

Solution (Python):
a = input()

print(2* min(a.count('1'),a.count('0') ))

Solution (Python):
s = list(input())
red = s.count("0")
blue = s.count("1")

print(len(s)-abs(red-blue))

Solution (Python):
c0=0
c1=0
for i in input():
  if i=="1":
    c1+=1
  else:
    c0+=1
print(min(c0,c1)*2)

Solution (Python):
s = input()
a = s.count("0")
b = s.count("1")
print((min(a,b))*2)

Solution (Python):
s = input()

c0 = s.count("0")
c1 = s.count("1")

print(min(c0,c1)*2)

Solution (Python):
s=input()
orig = len(s)
ones = sum([1 for x in s if x == '1'])
zeros = sum([1 for x in s if x == '0'])
print(2*min(ones, zeros))

Solution (Python):
n=input()
from collections import Counter
n0=Counter(n)
print(2*min(n0['0'],n0['1']))

Solution (Python):
*s,=input()
print(min(s.count("0"),s.count("1"))*2)

Solution (Python):
S = input()
print(min(S.count('1'),S.count('0'))*2)

Solution (Python):
s = input()
zero = s.count('0')
one = s.count('1')
print(str(len(s) - abs(zero - one)))

Solution (Python):
N=input()
a=N.count("0")
b=N.count("1")
if a==0 or b ==0:
  print(0)
elif a>=b:
  print(2*b)
else:
  print(2*a)

Solution (Python):
s=input()
print(2*min(s.count("0"),s.count("1")))

Solution (Python):
s = input()
print(min(s.count("1"),s.count("0"))*2)

Solution (Python):
S = input()
print(min(S.count("0"), S.count("1")) * 2)

Solution (Python):
S = input()
z = S.count("0")
o = S.count("1")

print(min(z, o) * 2)

Solution (Python):
S = input()

zero = 0
one = 0

for ch in S:
    if ch == "0":
        zero = zero + 1
    else:
        one = one + 1

print(min(zero, one) * 2)

Solution (Python):
S = input()
cnt0 = S.count("0")
cnt1 = S.count("1")

print(len(S)-abs(cnt0-cnt1))

Solution (Python):
s = input()
one = s.count('1')
zero = s.count('0')
print(min(one,zero) * 2)

Solution (Python):
s=list(input())
one=s.count('1')
zero=s.count('0')
print(2*min(one,zero))

Solution (Python):
s=list(map(int,input()))
i=0
ans=0

s=[s.count(0),s.count(1)]
print(min(s)*2)

Solution (Python):
S = input()
N = len(str(S))
cubes = [int(i) for i in list(S)]

one_count = len([i for i in cubes if i == 1])

if one_count > N - one_count:
  print(2 * (N - one_count))
else: 
  print(2 * one_count)

Solution (Python):
S=input()
N=len(S)

red=S.count("0")
blue=N-red

if red>=blue:
    print(N-red+blue)
else:
    print(N+red-blue)

Solution (Python):
S = list(input())

zero_count = 0
one_count = 0

for i in range(len(S)):
	if S[i] == '0':
		zero_count += 1
	else:
		one_count += 1

print(2 * min(zero_count, one_count))

Solution (Python):
def resolve():
    S = input()
    zeros = S.count("0")
    print(min(zeros, len(S)-zeros)* 2)

if '__main__' == __name__:
    resolve()

Solution (Python):
s = input()
l = list(s)
print(len(s)-abs(l.count('0')-l.count('1')))

Solution (Python):
s = input()
c = [s[0]]
for i in range(1,len(s)):
    if(len(c)==0 or (c[-1]=='1' and s[i]=='1') or (c[-1]=='0' and s[i]=='0')):
        c.append(s[i])
    else:
        del c[-1]
print(len(s)-len(c))

Solution (Python):
S = str(input())

count_0 = S.count("0")
count_1 = S.count("1")

ans = min(count_0 ,count_1) * 2
print(ans)

Solution (Python):
def resolve():
	S=input()
	print(min(S.count('1'),S.count('0'))*2)
resolve()

Solution (Python):


S = input()

zero_number = S.count('0')
one_number = S.count('1')

print(min(zero_number, one_number) * 2)

Solution (Python):
S = list(input())
print(min(S.count('1'), S.count('0')) * 2)

Solution (Python):
s = input()
print(2*min(s.count('0'), s.count('1')))

Solution (Python):
data = input()
data_list = [c for c in data]

count = 1
delete_count = 0
number_of_one = data_list.count('1')
number_of_zero = data_list.count('0')

min_num = min(number_of_zero, number_of_one)
print(min_num * 2)

Solution (Python):
S = input()

zero = 0
one = 0
for s in S:
    if s == "0":
        zero += 1
    else:
        one += 1

print(2 * min(zero, one))

Solution (Python):
S=input()
print(2*min(S.count("0"),S.count("1")))

Solution (Python):
s = input()
zero = s.count('0')
one = s.count('1')
print(2*min(zero,one))

Solution (Python):
s = input()
a = s.count('0')
b = s.count('1')
print(len(s) - max(a, b) + min(a, b))

Solution (Python):
S = input()
print(min(S.count('0'), S.count('1')) * 2)

Solution (Python):
from sys import stdin
import collections
S = stdin.readline().rstrip()
co = collections.Counter(S)
if len(co.most_common()) == 1:
    print('0')
else:
    print(co.most_common()[1][1] * 2)

Solution (Python):
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(input())
def LS(): return input().split()
def S(): return input()

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

print(main())