Input: Sentence: 'A pole with a clock on the top of it and a building in the background'. Count the number of nouns in this sentence.
Output: 5