Input: Sentence: 'A black cat relaxes atop a church, near a cross'. Count the number of nouns in this sentence.
Output: 3