Input: Sentence: 'A man and children are riding on the back of an elephant'. Count the number of nouns in this sentence.
Output: 4