Input: Sentence: 'half of a sandwich in a black tray on a table'. Count the number of nouns in this sentence.
Output: 4