def calculate_total_cost(house: House, job: Job): commute_loss = job.monthly_commute_income_loss(house.location) monthly_expenses = house.monthly_expences() salary = job.salary_after_tax() return salary - monthly_expenses - commute_loss