Input: Sentence: 'Several cows stick their heads out of a pen to feed'. Count the number of nouns in this sentence.
Output: 3