Input: Sentence: 'A man walking past a wooden bench near a building'. Count the number of nouns in this sentence.
Output: 3