input = input()
max = len(input)
go = True
counter =0
while(True):
  for x in range(0,max-2):
    if(input[x]!=input[x+1]):
      input = input[:x] + input[x+2:]
      max = len(input)
      counter +=2
      break
    else:
      go = False
print(counter)