S=input()
count=0
N=len(S)
for j in range(N//2):
  if (sum(map(int,S))==0)or(sum(map(int,S))==len(S)):
    break
  i=0
  while True:
    exam=str(S[i])+str(S[i+1])
    if exam[0]!=exam[1]:
      count+=1
      S.remove(exam)
      i-=1
    i+=1
    if i>=len(S)-1:
      break
print(2*count)