Input: Sentence: 'A man flying a kite at the beach while several people walk by'. Count the number of nouns in this sentence.
Output: 4