s = [int(i) for i in list(input())]

count = 0
flag = True

while flag:
  for i in range(len(s) - 1):
    if not s[i] == s[i+1]:
      del s[i:i+2]
      count += 2
      break
  else :
    flag = False

print(count)