NEW YORK (AP) - Citigroup Inc. and Morgan Stanley agreed Tuesday to combine their brokerages in a deal that shows how much Citigroup wants to slim down and build up cash. Morgan Stanley is paying Citigroup $2.7 billion for a 51 percent stake in the joint venture. Citigroup will have a 49 percent stake. Citigroup's retail brokerage, Smith Barney, was once the crown jewel in its wealth management business. The new unit, to be called Morgan Stanley Smith Barney, will have more than 20,000 advisors, $1.7 trillion in client assets; and serve 6.8 million households around the world, the companies said. Citigroup will recognize a pretax gain of about $9.5 billion because of the deal, or about $5.8 billion after taxes, the companies said. The joint venture is expected to achieve total cost savings for the two companies of around $1.1 billion. The deal was announced after the market closed. Shares of Citigroup rose 30 cents, or 5.4 percent, to $5.90 on Tuesday, and Morgan Stanley shares rose 7 cents to $18.86.