Input: Sentence: 'a sheep and a bird in a field of grass near a fence'. Count the number of nouns in this sentence.
Output: 5