Input: Sentence: 'a woman wearing a hat sitting on a bench with some other hats'. Count the number of nouns in this sentence.
Output: 4