instruction: how many of the patients with icd9 code 5012 remained admitted in hospital for more than 27 days?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN procedures ON demographic.hadm_id = procedures.hadm_id WHERE demographic.days_stay > "27" AND procedures.icd9_code = "5012"