Input: Sentence: 'Man riding a train looking out of a window'. Count the number of nouns in this sentence.
Output: 3