import itertools
import sys
input = sys.stdin.readline

S = input().rstrip('\n')
N = len(S)

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

# for i in itertools.count():
#     # print(S)
#     S = S.replace('01', '').replace('10', '')
#     if not S:
#         break
#     if S.count('0') == 0 or S.count('1') == 0:
#         break

# print(N-len(S)) import itertools itertools import sys sys input = sys.stdin.readline input sys.stdin.readline sys.stdin sys stdin readline S = input().rstrip('\n') S input().rstrip('\n') ().rstrip () input rstrip '\n' N = len(S) N len(S) len S print(2*min(S.count('0'), S.count('1'))) print 2*min(S.count('0'), S.count('1')) 2 min(S.count('0'), S.count('1')) min S.count('0') S.count S count '0' S.count('1') S.count S count '1' S = input().rstrip('\n') input().rstrip('\n') S input = sys.stdin.readline sys.stdin.readline input N = len(S) len(S) N
import itertools
import sys
input = sys.stdin.readline

S = input().rstrip('\n')
N = len(S)

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

# for i in itertools.count():
#     # print(S)
#     S = S.replace('01', '').replace('10', '')
#     if not S:
#         break
#     if S.count('0') == 0 or S.count('1') == 0:
#         break

# print(N-len(S))
