58000
The key to this problem is ignoring information that doesn't apply to the problem. We're looking for 40% of the purchase price for Mary's new home. We don't care about how much she's selling the old home for. So we just need to calculate 40% of 145000, so
40% * 145000 = 0.40 * 145000 = 58000
So the 40% down payment on her new 145000 house is 58000