Input: Sentence: 'a horse on a field of grass behind a fence'. Count the number of nouns in this sentence.
Output: 4