Input: Sentence: 'Cows in a barn eating from a trough'. Count the number of nouns in this sentence.
Output: 3