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

A = input()
N = len(A)

zero_num = A.count('0')
one_num = A.count('1')

if N == 1 or zero_num == 0 or one_num == 0:
    print(0)
    exit()

if N == 3:
    if zero_num == 1 or one_num == 1:
        print(2)
        exit()

if zero_num == one_num:
    ans = one_num*2
elif zero_num > one_num:
    ans = (int(zero_num/one_num) * one_num)*2
else:
    ans = (int(one_num / zero_num) * zero_num)*2

print(ans)