instruction: how many of the patients treated with main drug had a hospital stay of more than 5 days?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.days_stay > "5" AND prescriptions.drug_type = "MAIN"