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