Input: Sentence: 'A person is walking with their dog in a backpack in the park'. Count the number of nouns in this sentence.
Output: 4