Input: Sentence: 'A horse with a white spot near a fence'. Count the number of nouns in this sentence.
Output: 3