Input: Sentence: 'A person playing tug of war with a dog and a frisbee'. Count the number of nouns in this sentence.
Output: 5