Input: Sentence: 'Two horseback riders stop to rest on the shore'. Count the number of nouns in this sentence.
Output: 3