Input: Sentence: 'A group of people march across a field with a red flag'. Count the number of nouns in this sentence.
Output: 4