instruction: count the number of patients whose admission year is less than 2177 and diagnoses short title is 29-30 comp wks gestation?
response: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN diagnoses ON demographic.hadm_id = diagnoses.hadm_id WHERE demographic.admityear < "2177" AND diagnoses.short_title = "29-30 comp wks gestation"