Input: Sentence: 'A photo of a boy sitting on a bench next to a dog'. Count the number of nouns in this sentence.
Output: 4