human
Considering the provided database schema and associated query, produce SQL code to retrieve the answer to the query. 
###Database Schema: Episode #, Title, Air Date, Rating, Share, 18–49, Viewers, Rank
###Question: What is the total number of Viewers when the rank is #40?
gpt
SELECT COUNT Viewers FROM table WHERE Rank = #40