Input: Sentence: 'A herd of elephants walking over a rocky area with trees in the background'. Count the number of nouns in this sentence.
Output: 5