40Bn US?
What fantasy planet are you living on?
At most 14BN US could be spent on Orion. Do Some research and basic math and you will find the "Scotty factor"
It is overage by x4!
You seem to be fairly misinformed about NASAs budget on human space flight. You do not have to calculate yourself any fictive numbers. Fiscal experts inside and outside NASA have done this already on a firm knowledge base and on current Constellation numbers and facts.
In 2006 the Ares 1 development was proposed to cost 28 billion USD through 2015, which had been risen to more than 40 billion USD in 2009 (to be more precisely: to roughly 49 billion USD). The money already spend is 9 billion USD only for first stage development. There is no second stage hardware, no Orion hardware and no launch escape system hardware (just mockups). Not to mention the small Ares V wind tunnel model, which is the only Ares V hardware that will ever exist. Constellation was underfunded anyway, and additionally went over-budget.
To achive the goals of Constellation from 2010 to 2020, 145 billion USD would have been required all in all, which does not include an ISS extension to 2020. If Constellation would have been accompanied by an ISS extension to 2020, 159 billion USD would have been required for that period of manned space flight.
You may want to read the Review of U.S. Human Space Flight by the Augustine Commission:
http://www.nasa.gov/pdf/396093main_HSF_Cmte_FinalReport.pdfLook at US spaceflight history.
Which would have been my next point anyway:
The Apollo program costs through 1972, including the 6 manned moon landings, was about 25 billion 1969 USD which is about 145 billion 2008 USD. Not included in this costs is the entire program costs i.e. all Saturn 1b and V launches and missions including Skylab and the ASTP (Apollo Soyuz Test Project).
To reduce those enormous costs for manned space flight, NASA and the congress intended to build a reusable space plane that would be "profitable". That was the birth of the Space Transportation System in 1972 (the votes for the Shuttle took place when John Young was on the Moon with Apollo 16). The Shuttle was believed to fly about 600 times until the year 2000 and being cost-efficient (some studies implied the Shuttle could even fly more often). But just like Apollo, STS turned out to be a budget eater as well.
Just like the Shuttle initially, Constellation also was believed to be cost-efficient. But once again in NASAs history, instead it suffered from an extreme over-budget. 145 billion USD from 2010 to 2020 without ISS extension to 2020, that's more than the Apollo budget through 1972. Nothing has changed. NASA is not able to do cost-efficient manned space flight. That's exactly why commercial space flight will be on the table for the first time.