Input: Sentence: 'A cat sitting next to a pair of legs on the ground'. Count the number of nouns in this sentence.
Output: 4