How much house can i afford?

How much house can I afford?

I’m 28 years old looking to buy a house within the next 3-5 years. Ive been told as a general rule of thumb, you can afford a house that costs 5x your gross annual income. Here is my financial situation:
Girlfriend and I (soon to be married) gross income of 240k

115k in 401k/IRA

50k in a cash/investment account

800k inheritence. This figure is all invested in stocks and moves with the market daily.

Girlfriend has ~50k in student loans.
Ideally i would like my inheritence to sit there and grow overtime, but figure eventually ill need to dip into it in order for a downpayment on a home.