Input: Sentence: 'A room with two green sofas, brown carpet, and green walls'. Count the number of nouns in this sentence.
Output: 4