#coding: utf-8
s = list(map(int, input()))
if len(s) <= 1:
    print(0)
else:
    zero = [i for i, x in enumerate(s) if x == 0]
    one = [i for i, x in enumerate(s) if x == 1]
    zeros = s[:zero[-1]].count(0)
    ones = s[:one[-1]].count(1)
    print(zeros * 2 if zeros < ones else ones * 2)
