Input: Sentence: 'A brown patterned dog being held wearing a hat'. Count the number of nouns in this sentence.
Output: 2