It seems trivially fixable if you RLHF an LLM to always count characters deterministically with:
sum(1 for c in word if c == "r")