Long-Context LLMs Meet RAG: Overcoming Challenges for Long Inputs in RAG