Input: Sentence: 'Three planes that are flying while leaving smoke behind them'. Count the number of nouns in this sentence.
Output: 2