Instruct: How many total medals does rank 3 with less than 40 silver medals?
Output: SELECT MAX Total FROM table WHERE Silver < 40 AND Rank = 3