Input: Sentence: 'A train that is sitting on the tracks near a building'. Count the number of nouns in this sentence.
Output: 3