Input: Sentence: 'A man riding on the back of an elephant near a lake'. Count the number of nouns in this sentence.
Output: 4