"""a,b,c = map(int,input().split())
l =[]
for i in range(1,min(a,b)):
  if min(a,b)%i==0:
    l.append(i)

print(l[c-1])"""

s = input()
one,zero = s.count("1"),s.count("0")
if len(s)==1:
  print(0)
if len(set(s))==1:
  print(0)
else:
  print(min(one,zero)*2)