Input: Sentence: 'A black and white photo of a man petting a horse'. Count the number of nouns in this sentence.
Output: 3