Input: Sentence: 'A small white dog wearing a black hat'. Count the number of nouns in this sentence.
Output: 2