Input: Sentence: 'A sphere like object holding up a hat'. Count the number of nouns in this sentence.
Output: 3