Input: Sentence: 'A man with his hand to the nose of a horse'. Count the number of nouns in this sentence.
Output: 4