Input: Sentence: 'A man rests his head on another man's shoulder for a photo'. Count the number of nouns in this sentence.
Output: 5