Input: Sentence: 'A bear leans on an embankment while people watch him'. Count the number of nouns in this sentence.
Output: 3