Input: Sentence: 'A collection of books and knick-knacks on shelves'. Count the number of nouns in this sentence.
Output: 5