Under the Medicare Inpatient Prospective Payment System (IPPS), what primarily determines the payment a hospital receives for a stay?