Input: Sentence: 'A couple of cops riding on the back of horses'. Count the number of nouns in this sentence.
Output: 4