Input: Sentence: 'A cat laying on its back on a bed'. Count the number of nouns in this sentence.
Output: 3