Input: Sentence: 'A man playing a game while the woman is carrying a bag'. Count the number of nouns in this sentence.
Output: 4