###HUMAN: how many patients whose admission year is less than 2166 and drug name is loperamide?, ###ASSISTANT: SELECT COUNT(DISTINCT demographic.subject_id) FROM demographic INNER JOIN prescriptions ON demographic.hadm_id = prescriptions.hadm_id WHERE demographic.admityear < "2166" AND prescriptions.drug = "Loperamide"