Looking for a new car can be intimidating, especially if you don’t have a set budget in mind when you walk onto the lot. Fortunately, there’s a handy rule of thumb that you can use to determine what you can afford to spend. Just remember these numbers: 10, 20, and four.

According to the finance blog I Will Teach You To Be Rich, car expenses—including monthly payments, gas, interest, maintenance, and insurance—should cost no more than 10 percent of your gross monthly income. But how do you calculate monthly car payments from the total price of a new car?

First, you should commit to putting a 20 percent down payment on the vehicle before taking it home. To cover the rest of the cost, plan on making monthly payments for no more than four years. That means your car payments will come out to be the total cost of the vehicle, minus the 20 percent down payment, divided by 48 months. Add in the estimated cost of insurance, gas, and other necessities, and that's what you can expect to spend on your car each month.

If you’re planning on bringing home a new (or used) car, it’s vital to have these numbers calculated before you start the process. Then, once you have the math figured out, all you have to worry about are your negotiating skills.

[h/t I Will Teach You to Be Rich]