Input: Sentence: 'A man taking a swing at a tennis ball'. Count the number of nouns in this sentence.
Output: 4