The logic is sound with regards to giving it a few examples and splitting tasks into sub-tasks, that's how they prime their model to evaluate it on all NLP benchmarks in the GPT papers and I've solved many problems like that in ChatGPT.
I've replied to the other comment with a prompt that actually works for any sentence.