Input: Sentence: 'An elephant standing on rocks and grass next to a fence'. Count the number of nouns in this sentence.
Output: 4