Input: Sentence: 'A pan with ham on it sitting on top of an oven with a knife next to it'. Count the number of nouns in this sentence.
Output: 5