Input: Sentence: 'A train car with four beds next to a window'. Count the number of nouns in this sentence.
Output: 4