Input: Sentence: 'A herd of horses running in a field by some trees'. Count the number of nouns in this sentence.
Output: 4