Input: Sentence: 'A man is holding onto a horse on a rope'. Count the number of nouns in this sentence.
Output: 3