function main()
  
  S = split(readline(),"")
  
  num = 1
  check = true
  ans = 0
  
  while check
    
    check = false
    
	for i in 2:length(S)

      if S[num] != "" && S[i] != "" && S[num] != S[i]
        S[num] = ""
        S[i] = ""
        ans += 2
      end
    
      if S[i] != ""
        num = i
      end
      
    end

    for i in 2:length(S)
      
      if S[i] != "" && S[num] != S[i]
        check = true
      end
    
      if S[i] != ""
        num = i
      end

    end
    
  end

  println(ans)
  
end

main()