instruction: provide the number of patients whose admission type is emergency and procedure long title is drug detoxification?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.admission_type = "EMERGENCY" AND procedures.long_title = "Drug detoxification"