Input: Sentence: 'a gray black and yellow bird an apple and red and yellow leaves'. Count the number of nouns in this sentence.
Output: 3