Input: Sentence: 'A spotted dog cuddled up under large pillows'. Count the number of nouns in this sentence.
Output: 2