# -*- coding: utf-8 -*-

"""

Created on Sun Mar  3 19:52:53 2019



@author: Yamazaki Kenichi

"""

from collections import deque



S = eval(input())



ans = 0

q=deque([' '])

for c in S:

    tmp = q.pop()

    s = tmp+c

    if s.count('0') >= 1 and s.count('1') >= 1:

        ans += 2

    else:

        q.append(tmp)

        q.append(c)

print(ans)
# -*- coding: utf-8 -*-

"""

Created on Sun Mar  3 19:52:53 2019



@author: Yamazaki Kenichi

"""

S = eval(input())

print((2*min(S.count('0'),S.count('1'))))
# -*- coding: utf-8 -*-
"""
Created on Sun Mar  3 19:52:53 2019
@author: Yamazaki Kenichi
"""
from collections import deque

S = eval(input())
ans = 0
q = deque([" "])
for c in S:
    tmp = q.pop()
    s = tmp + c
    if s.count("0") >= 1 and s.count("1") >= 1:
        ans += 2
    else:
        q.append(tmp)
        q.append(c)
print(ans)

# -*- coding: utf-8 -*-
"""
Created on Sun Mar  3 19:52:53 2019
@author: Yamazaki Kenichi
"""
S = eval(input())
print((2 * min(S.count("0"), S.count("1"))))

-from collections import deque - -ans = 0 -q = deque([" "]) -for c in S: -    tmp = q.pop() -    s = tmp + c -    if s.count("0") >= 1 and s.count("1") >= 1: -        ans += 2 -    else: -        q.append(tmp) -        q.append(c) -print(ans) +print((2 * min(S.count("0"), S.count("1"))))