That’s why Cambridge counts “can’t” as one word. In general, if the contraction can be expanded to a single word, then it’s a single word.
If you use “ain’t” does the word count stay the same because it’s not a word?