Input: Sentence: 'A dog is laying on a bed next to pillows'. Count the number of nouns in this sentence.
Output: 3