Input: Sentence: 'A train engine carrying carts down a track'. Count the number of nouns in this sentence.
Output: 4