Input: Sentence: 'Two people with dogs walking by a modern building in a city'. Count the number of nouns in this sentence.
Output: 4