Input: Sentence: 'A photograph taken from an airplane window while in flight'. Count the number of nouns in this sentence.
Output: 4