s=[int(x) for x in list(input())]
cnt=0
l=0
while 1:
  #print(s,l)
  if len(s)<2 or l ==len(s)-1:
    break
  #print(l)
  if s[l]^s[l+1]:
    s.pop(l)
    s.pop(l)
    cnt += 2
    l=0
  else:
    l += 1
print(cnt)