Input: Sentence: 'A horse and cart by the side of a heavily trafficked road'. Count the number of nouns in this sentence.
Output: 4