Input: Sentence: 'a gentleman in pajamas taking a selfie with his camera'. Count the number of nouns in this sentence.
Output: 4