instruction: count the number of patients whose primary disease is s/p hanging and drug type is main?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.diagnosis = "S/P HANGING" AND prescriptions.drug_type = "MAIN"