Input: Sentence: 'A young man with a blue tie is playing with a boy while a man in the background looks on'. Count the number of nouns in this sentence.
Output: 5