Financial advice?

How much should you have in savings to buy a 40k car outright without a loan?

Edit: obviously you need the 40k but I’m assuming it wouldn’t be a great idea to use every dime you have on a car. So how much extra should you have saved for it financially to make sense.