Input: Sentence: 'A giraffe is on the grassy field by a tree'. Count the number of nouns in this sentence.
Output: 3