Input: Sentence: 'A man holding a cake on a plate with a rag'. Count the number of nouns in this sentence.
Output: 4