Brief explanation: The question asks about the place where medicine is purchased.
Answer (German):
Ich kaufe Medikamente in der Apotheke.
Translation (Russian):
Я покупаю лекарства в аптеке.
Explanation: 'in der Apotheke' means 'in the pharmacy'. 'Apotheke' is a feminine noun. When asking about the location (where), the dative case is used after the preposition 'in', hence 'in der'.