The Corner Café sells coffee in small, medium, and large sizes. One weekend, the shop sold 3,289 cups of coffee. The shop sold 3 times as many medium cups of coffee as small cups. They sold 3 times as many large cups of coffee as medium cups. How many medium cups of coffee did the shop sell?