Input: Sentence: 'A bear walks through the trees and on the side of the mountain'. Count the number of nouns in this sentence.
Output: 4