Input: Sentence: 'A black cow standing on a beach looking towards a patch of grass'. Count the number of nouns in this sentence.
Output: 4