Input: Sentence: 'A man smiling in a suit and tie, wearing a hat'. Count the number of nouns in this sentence.
Output: 3