Input: Sentence: 'River with ducks swimming in it surrounded by leafless trees and brown grass'. Count the number of nouns in this sentence.
Output: 4