Input: Sentence: 'A dog and a horse interacting with a man'. Count the number of nouns in this sentence.
Output: 3