Input: Sentence: 'A man smiling as he holds two ties while a lady sits nearby'. Count the number of nouns in this sentence.
Output: 3