Input: Sentence: 'a cake decorated with trees and a river'. Count the number of nouns in this sentence.
Output: 3