Input: Sentence: 'A man with a baby holding a carrot'. Count the number of nouns in this sentence.
Output: 3