Input: Sentence: 'A black and white cat lying on top of a teddy bear'. Count the number of nouns in this sentence.
Output: 4