Input: Sentence: 'Two horses and a man are on the beach'. Count the number of nouns in this sentence.
Output: 3