Input: Sentence: 'A mother sheep and her lamb in the middle of a pasture'. Count the number of nouns in this sentence.
Output: 5