Task: Program Execution
Input (English): Sentence: 'a man on a bed reading a book wearing a hat'. How many words end with the letter 'g' in the sentence.
Output (English): 2