Input: Sentence: 'A person on a horse riding in the grass'. Count the number of nouns in this sentence.
Output: 3