
# -*- coding: utf-8 -*-
# 整数の入力
# a = int(input())
s = input()
# s = '11011010001011'
# スペース区切りの整数の入力
# a, b, k = map(int, input().split())

counter = 0
while s.find('01') != -1 or s.find('10') != -1:
    if s.find('01') != -1:
        s = s.replace('01', '', 1)
        counter += 2
    if s.find('10') != -1:
        s = s.replace('10', '', 1)
        counter += 2

# 出力
print("{}".format(int(counter)))