Input: Sentence: 'An older man sits on a bench while gazing at the water'. Count the number of nouns in this sentence.
Output: 3