Input: Sentence: 'a small black dog is playing with a green toy'. Count the number of nouns in this sentence.
Output: 2