Input: Sentence: 'A tray with a doughnut and a cup of coffee on it'. Count the number of nouns in this sentence.
Output: 4