Input: Sentence: 'A bird perched in a tree with a partially eaten apple'. Count the number of nouns in this sentence.
Output: 3