I had dinner at my friend Alan’s house earlier this week. You could call it a mini-housewarming party. With a baby on the way, he and his wife decided to upgrade their house in anticipation. They’ve finally settled in, and I was their first non-family guest.

It might as well be a castle.

Four-car garage, swimming pool that resembles Hugh Hefner’s grotto, and a media room with better equipment than an actual movie theater… He cranked up the volume to show me what it could do. Three days later and my ears are still ringing.

It has a wine cellar, and a kitchen that would make a three-star Michelin chef jealous.

In the study, there is a secret door behind the bookshelf that leads to a hidden room, like something from a Batman movie.

There are houses. And there are houses. This one was the latter.

The Dream House

Now, you could argue that a house like that is nothing more than a vanity project; Alan would agree. He knows the entire project is ridiculous. No one needs a house like that.

But he’s done fantastically well in his career and could afford it. He made a 30% down payment in cash, and he’ll be reducing the mortgage further when his old house sells.

At his income level, he could pay down the remainder of the mortgage in two or three years without stretching his budget. This is a toy for him. He’s earned millions, and he can’t take it with him. So, he might as well have a little fun with it.

This raises larger questions for the rest of us: how much house is too much?

Before I answer that, we need to establish the first law of homeownership: Your house is not an asset.

I repeat: Your house is not an asset.

It generates no income for you, yet it generates plenty of expenses: taxes, insurance, utility bills, landscaping, the pool guy, the technician to fix your state-of-the-art home theater system when something goes wrong… These are expenses that can potentially bleed you dry.

Sure, your home equity has cash value. But you can’t extract it without selling or mortgaging your house.

Your house is an expense, and you should view it through that lens. Every dollar you tie up in your house is a dollar you can’t invest and use to grow your wealth.

To calculate how much house is appropriate for you, it’s probably easiest to back into the number.

Calculating the Cost of Your Home

Make a tally of your spending priorities — retirement savings, college savings, capital to start a business, day to day spending money, etc. — and subtract that from your household income. Give yourself a little wiggle room. You don’t want to be agonizing over a $4 purchase at Starbucks because you’ve made your budget unrealistically tight.

Once you’ve figured out how much you think you can afford as a monthly payment, knock off another 20%. You probably forgot a few expenses, and, again, you don’t want to be strapped for cash every month when the mortgage payment comes due.

If you have $10,000 per month left over, good for you! Go buy a mansion. You can afford it.

If you have $2,000 per month left over, then that’s your budget. End of story.

Trying to stretch it to buy a larger house is only going to cause you stress, and your home shouldn’t be a cause of stress. It should be a place you go to escape from stress.

As for the dollar price of the house you can afford, that’s going to depend on a couple factors, such as taxes and your area and mortgage rates. But if you know the size of the monthly payment you can afford, there are plenty of online calculators that can do the math for you and calculate the house price. As an example, you can check out NerdWallet’s calculator.

The point is, don’t buy more house than you can comfortably afford.

While I’d love to have a Hugh Hefner grotto like my buddy Alan — and I might very well buy one someday — I’m far more comfortable living more modestly and being able to max out my retirement accounts and spoil my kids.