Input: Sentence: 'A woman riding a horse and petting it in a corral'. Count the number of nouns in this sentence.
Output: 3