Input: Sentence: 'A cat laying on a rug playing with a dog's tale'. Count the number of nouns in this sentence.
Output: 5