Input: Sentence: 'A train on a bridge traveling over a body of water'. Count the number of nouns in this sentence.
Output: 4