str = input()
n = 0
cnt = 0
f = True
while f == True:
  s = list(str)
  f = False
  for i in range(len(str)-1):
#    print(len(str))
    if s[i] != s[i+1] and s[i] != "":
      s[i] = ""
      s[i+1] = ""
      cnt += 1
      f = True
  str = "".join(s)
#  print(str)
print(2*cnt)