Input: Sentence: 'A horse being ridden with a man in a large hat'. Count the number of nouns in this sentence.
Output: 3