Input: Sentence: 'A person walking through a park next to a tree'. Count the number of nouns in this sentence.
Output: 3