Input: Sentence: 'Two brown cats laying on top of green pillows on a bed'. Count the number of nouns in this sentence.
Output: 4