In practice the safest way to get an LLM to do counting or string operations is to use external tools, like Python. ChatGPT has Python built in, but for simple problems you need to ask it to use it. So, if you *must*, this is the best way to count the r's in "strawberry" is:
