Input: Sentence: 'A cat lays on top of a shelf'. Count the number of nouns in this sentence.
Output: 3