Input: Sentence: 'A man is smiling while sitting in a chair with a large dog in his lap'. Count the number of nouns in this sentence.
Output: 4