How Much Can RAG Help the Reasoning of LLM?