Input: Sentence: 'A cat walking through a doorway as a person watches'. Count the number of nouns in this sentence.
Output: 3