Input: Sentence: 'A man riding a white horse on a sandy beach'. Count the number of nouns in this sentence.
Output: 3