Input: Sentence: 'An old self portrait of a man dressed nice'. Count the number of nouns in this sentence.
Output: 3