S = list(map(int, input()))

count = 0
for i in range(len(S)):
  if S[i]!=S[i+1]:
  	del S[i],S[i+1]
    count +=2
  	continue  
  elif S[len(S)]==S[len(S)+1]
  	break
  else:
  	continue
    
print(count)