In this task, you need to count the number of words in a sentence that end with the given letter. Answer with numbers and not words.
Sentence: 'a small cat sticks its head in a bag while someone puts a textual joke on it'. How many words end with the letter 'n' in the sentence.