Input: Sentence: 'A dog hanging out of a car in front of a rear view mirror'. Count the number of nouns in this sentence.
Output: 5