Input: Sentence: 'A train traveling over a bridge next to lots of trees'. Count the number of nouns in this sentence.
Output: 4