Input: Sentence: 'A man and a woman laugh together as they walk out in the rain beneath a purple umbrella'. Count the number of nouns in this sentence.
Output: 4