Input: Sentence: 'Several people are on the beach riding their horses'. Count the number of nouns in this sentence.
Output: 3